MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / String

Method String

graphql/schema/remote.go:716–737  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

714}
715
716func (t *gqlType) String() string {
717 if t == nil {
718 return ""
719 }
720 // refer http://spec.graphql.org/June2018/#sec-Type-Kinds
721 // it confirms, if type kind is LIST or NON_NULL all other fields except ofType will be
722 // null, so there won't be any name at that level. For other kinds, there will always be a name.
723 switch t.Kind {
724 case list:
725 return fmt.Sprintf("[%s]", t.OfType.String())
726 case nonNull:
727 return fmt.Sprintf("%s!", t.OfType.String())
728 // TODO: we will consider ID as String for the purpose of type matching
729 //case "SCALAR":
730 // if t.Name == "ID" {
731 // return "String"
732 // }
733 // return t.Name
734 default:
735 return t.Name
736 }
737}
738
739func (t *gqlType) NamedType() string {
740 if t.Name != "" {

Callers 15

runFunction · 0.45
getBatchTypeFunction · 0.45
removeDirFunction · 0.45
saveQueryDurationsFunction · 0.45
saveBenchmarkStatsFunction · 0.45
ExecuteMethod · 0.45
AsStringFunction · 0.45
ResolveMethod · 0.45
ResolveMethod · 0.45
convertScalarToStringFunction · 0.45

Calls

no outgoing calls

Tested by 15

newClientFunction · 0.36
TestValueCoercionFunction · 0.36
TestQueryAliasFunction · 0.36
TestMutationAliasFunction · 0.36
TestResponseOrderFunction · 0.36
TestGqlType_StringFunction · 0.36
TestDataAndErrorsFunction · 0.36