Schema
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.
| Kind | Constructor | Used for |
|---|---|---|
| Object | graphql.NewObject | Named sets of fields, and the Query, Mutation and Subscription roots. |
| Interface | graphql.NewInterface | Fields shared by several object types. |
| Union | graphql.NewUnion | A value that is one of several object types. |
| Enum | graphql.NewEnum | A fixed set of values. |
| Input object | graphql.NewInputObject | Structured arguments. |
| Scalar | graphql.NewScalar | Leaf values. Int, Float, String, Boolean, ID and DateTime are built in. |
| List | graphql.NewList | A list of another type. |
| Non-null | graphql.NewNonNull | A type that is never null. |
The guides in this section explain each kind, and the API reference documents every constructor and configuration option.
Object types, fields, arguments, lists and non-null, types that refer to each other, and the schema.
Abstract types, choosing the object type of a value, listing implementations, and querying with fragments.
Named values mapped to Go values, enum fields and arguments, and deprecated values.
Structured arguments, reading and decoding them, literals and variables, and mutations.
The built-in scalars, and defining your own with Serialize, ParseValue and ParseLiteral.
@include, @skip and @deprecated, declaring custom directives, and acting on them in resolvers.
Values of your own on types, fields and arguments, for generic resolvers and middleware.
Last updated on