Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.GraphQL.Type.Schema
Description
This module provides a representation of a GraphQL
Schema in addition to
functions for defining and manipulating schemas.
Synopsis
- schema :: forall (m :: Type -> Type). ObjectType m -> Maybe (ObjectType m) -> Maybe (ObjectType m) -> Directives -> Schema m
- schemaWithTypes :: forall (m :: Type -> Type). Maybe Text -> ObjectType m -> Maybe (ObjectType m) -> Maybe (ObjectType m) -> [Type m] -> Directives -> Schema m
- data Type (m :: Type -> Type)
- data Schema (m :: Type -> Type)
- data Directive = Directive (Maybe Text) Arguments Bool [DirectiveLocation]
- type Directives = HashMap Name Directive
- description :: forall (m :: Type -> Type). Schema m -> Maybe Text
- directives :: forall (m :: Type -> Type). Schema m -> Directives
- implementations :: forall (m :: Type -> Type). Schema m -> HashMap Name [Type m]
- mutation :: forall (m :: Type -> Type). Schema m -> Maybe (ObjectType m)
- subscription :: forall (m :: Type -> Type). Schema m -> Maybe (ObjectType m)
- query :: forall (m :: Type -> Type). Schema m -> ObjectType m
- types :: forall (m :: Type -> Type). Schema m -> HashMap Name (Type m)
Documentation
Arguments
:: forall (m :: Type -> Type). ObjectType m | Query type. |
-> Maybe (ObjectType m) | Mutation type. |
-> Maybe (ObjectType m) | Subscription type. |
-> Directives | Directive definitions. |
-> Schema m | Schema. |
Schema constructor.
Note: When the schema is constructed, by default only the types that
are reachable by traversing the root types are included, other types must
be explicitly referenced using schemaWithTypes
instead.
Arguments
:: forall (m :: Type -> Type). Maybe Text | Schema description |
-> ObjectType m | Query type. |
-> Maybe (ObjectType m) | Mutation type. |
-> Maybe (ObjectType m) | Subscription type. |
-> [Type m] | Additional types. |
-> Directives | Directive definitions. |
-> Schema m | Schema. |
Constructs a complete schema, including user-defined types not referenced in the schema directly (for example interface implementations).
data Type (m :: Type -> Type) Source #
These are all of the possible kinds of types.
Constructors
ScalarType ScalarType | |
EnumType EnumType | |
ObjectType (ObjectType m) | |
InputObjectType InputObjectType | |
InterfaceType (InterfaceType m) | |
UnionType (UnionType m) |
data Schema (m :: Type -> Type) Source #
A Schema is created by supplying the root types of each type of operation, query and mutation (optional). A schema definition is then supplied to the validator and executor.
Directive definition.
A definition consists of an optional description, arguments, whether the directive is repeatable, and the allowed directive locations.
directives :: forall (m :: Type -> Type). Schema m -> Directives Source #
Schema directive definitions.
implementations :: forall (m :: Type -> Type). Schema m -> HashMap Name [Type m] Source #
Interface implementations.
mutation :: forall (m :: Type -> Type). Schema m -> Maybe (ObjectType m) Source #
Schema mutation type.
subscription :: forall (m :: Type -> Type). Schema m -> Maybe (ObjectType m) Source #
Schema subscription type.