GetQuery gets a single schema.Query from a schema.Operation. It will fail if op is not a query or there's more than one query in op.
(t *testing.T, op schema.Operation)
| 72 | // It will fail if op is not a query or there's more than one query in |
| 73 | // op. |
| 74 | func GetQuery(t *testing.T, op schema.Operation) schema.Query { |
| 75 | require.NotNil(t, op) |
| 76 | |
| 77 | queries := op.Queries() |
| 78 | require.Len(t, queries, 1) |
| 79 | |
| 80 | return queries[0] |
| 81 | } |
| 82 | |
| 83 | // RequireJSONEq converts to JSON and tests JSON equality. |
| 84 | // It's easier to understand the diff, when a test fails, with json than |