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

Function LoadSchemaFromFile

graphql/test/test.go:42–47  ·  view source on GitHub ↗

LoadSchemaFromFile reads a graphql schema file as would be the initial schema definition. It runs all validation, generates the completed schema and returns that.

(t *testing.T, gqlFile string)

Source from the content-addressed store, hash-verified

40// definition. It runs all validation, generates the completed schema and
41// returns that.
42func LoadSchemaFromFile(t *testing.T, gqlFile string) schema.Schema {
43 gql, err := os.ReadFile(gqlFile)
44 require.NoError(t, err, "Unable to read schema file")
45
46 return LoadSchemaFromString(t, string(gql))
47}
48
49func LoadSchemaFromString(t *testing.T, sch string) schema.Schema {
50 handler, err := schema.NewHandler(sch, false)

Callers 13

mutationValidationFunction · 0.92
benchmark3LevelDeepFunction · 0.92
deleteMutationRewritingFunction · 0.92
mutationRewritingFunction · 0.92
TestCustomHTTPMutationFunction · 0.92
TestQueryRewritingFunction · 0.92
TestCustomHTTPQueryFunction · 0.92
TestValueCoercionFunction · 0.92
TestQueryAliasFunction · 0.92
panicCatcherFunction · 0.92

Calls 1

LoadSchemaFromStringFunction · 0.85

Tested by 11

mutationValidationFunction · 0.74
benchmark3LevelDeepFunction · 0.74
deleteMutationRewritingFunction · 0.74
mutationRewritingFunction · 0.74
TestCustomHTTPMutationFunction · 0.74
TestQueryRewritingFunction · 0.74
TestCustomHTTPQueryFunction · 0.74
TestValueCoercionFunction · 0.74
TestQueryAliasFunction · 0.74