(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestExtendingNonExistantTypes(t *testing.T) { |
| 16 | s := gqlparser.MustLoadSchema( |
| 17 | &ast.Source{Name: "graph/schema.graphqls", Input: ` |
| 18 | extend type User { |
| 19 | id: ID! |
| 20 | } |
| 21 | |
| 22 | extend type Product { |
| 23 | upc: String! |
| 24 | } |
| 25 | |
| 26 | union _Entity = Product | User |
| 27 | |
| 28 | extend type Query { |
| 29 | entity: _Entity |
| 30 | } |
| 31 | `, BuiltIn: false}, |
| 32 | ) |
| 33 | |
| 34 | q, err := parser.ParseQuery(&ast.Source{Name: "ff", Input: `{ |
| 35 | entity { |
| 36 | ... on User { |
| 37 | id |
| 38 | } |
| 39 | } |
| 40 | }`}) |
| 41 | require.NoError(t, err) |
| 42 | |
| 43 | require.Nil(t, validator.Validate(s, q)) |
| 44 | require.Nil(t, validator.ValidateWithRules(s, q, nil)) |
| 45 | } |
| 46 | |
| 47 | func TestValidationRulesAreIndependent(t *testing.T) { |
| 48 | s := gqlparser.MustLoadSchema( |
nothing calls this directly
no test coverage detected
searching dependent graphs…