test

package
v25.0.0-custom-qt-impr... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMutation

func GetMutation(t *testing.T, op schema.Operation) schema.Mutation

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

func GetQuery(t *testing.T, op schema.Operation) schema.Query

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

func LoadSchema(t *testing.T, gqlSchema string) schema.Schema

LoadSchema parses and validates the given schema string and requires no errors.

func LoadSchemaFromFile

func LoadSchemaFromFile(t *testing.T, gqlFile string) schema.Schema

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 LoadSchemaFromString

func LoadSchemaFromString(t *testing.T, sch string) schema.Schema

func RequireJSONEq

func RequireJSONEq(t *testing.T, expected, got interface{})

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

func RequireJSONEqStr(t *testing.T, expected string, got interface{})

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL