Various helpers used in GQL testing LoadSchema parses and validates the given schema string and requires no errors.
(t *testing.T, gqlSchema string)
| 24 | // LoadSchema parses and validates the given schema string and requires |
| 25 | // no errors. |
| 26 | func LoadSchema(t *testing.T, gqlSchema string) schema.Schema { |
| 27 | |
| 28 | doc, gqlErr := parser.ParseSchemas(validator.Prelude, &ast.Source{Input: gqlSchema}) |
| 29 | requireNoGQLErrors(t, gqlErr) |
| 30 | |
| 31 | gql, gqlErr := validator.ValidateSchemaDocument(doc) |
| 32 | requireNoGQLErrors(t, gqlErr) |
| 33 | |
| 34 | schema, err := schema.AsSchema(gql, x.RootNamespace) |
| 35 | requireNoGQLErrors(t, err) |
| 36 | return schema |
| 37 | } |
| 38 | |
| 39 | // LoadSchemaFromFile reads a graphql schema file as would be the initial schema |
| 40 | // definition. It runs all validation, generates the completed schema and |
no test coverage detected