Documentation
¶
Index ¶
- func GetMutation(t *testing.T, op schema.Operation) schema.Mutation
- func GetQuery(t *testing.T, op schema.Operation) schema.Query
- func LoadSchema(t *testing.T, gqlSchema string) schema.Schema
- func LoadSchemaFromFile(t *testing.T, gqlFile string) schema.Schema
- func LoadSchemaFromString(t *testing.T, sch string) schema.Schema
- func RequireJSONEq(t *testing.T, expected, got interface{})
- func RequireJSONEqStr(t *testing.T, expected string, got interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMutation ¶
GetMutation gets a single schema.Mutation from a schema.Operation. It will fail if op is not a mutation or there's more than one mutation in op.
func GetQuery ¶
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.
func LoadSchema ¶
LoadSchema parses and validates the given schema string and requires no errors.
func LoadSchemaFromFile ¶
LoadSchemaFromFile reads a graphql schema file as would be the initial schema definition. It runs all validation, generates the completed schema and returns that.
func RequireJSONEq ¶
RequireJSONEq converts to JSON and tests JSON equality. It's easier to understand the diff, when a test fails, with json than require.Equal on for example GraphQL error lists.
func RequireJSONEqStr ¶
RequireJSONEqStr converts to JSON and tests JSON equality. It's easier to understand the diff, when a test fails, with json than require.Equal on for example GraphQL error lists.
Types ¶
This section is empty.