Skip to content

Schema

A schema describes what clients can ask for. In this library it is built in Go code: each GraphQL type is a value created with a constructor, and graphql.NewSchema checks them and ties them to the root operation types.

KindConstructorUsed for
Objectgraphql.NewObjectNamed sets of fields, and the Query, Mutation and Subscription roots.
Interfacegraphql.NewInterfaceFields shared by several object types.
Uniongraphql.NewUnionA value that is one of several object types.
Enumgraphql.NewEnumA fixed set of values.
Input objectgraphql.NewInputObjectStructured arguments.
Scalargraphql.NewScalarLeaf values. Int, Float, String, Boolean, ID and DateTime are built in.
Listgraphql.NewListA list of another type.
Non-nullgraphql.NewNonNullA type that is never null.

The guides in this section explain each kind, and the API reference documents every constructor and configuration option.

Last updated on