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)
| 40 | // definition. It runs all validation, generates the completed schema and |
| 41 | // returns that. |
| 42 | func 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 | |
| 49 | func LoadSchemaFromString(t *testing.T, sch string) schema.Schema { |
| 50 | handler, err := schema.NewHandler(sch, false) |