Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a representation of a GraphQL
Schema in addition to
functions for defining and manipulating schemas.
Synopsis
- schema :: forall m. ObjectType m -> Maybe (ObjectType m) -> Maybe (ObjectType m) -> Directives -> Schema m
- schemaWithTypes :: forall m. Maybe Text -> ObjectType m -> Maybe (ObjectType m) -> Maybe (ObjectType m) -> [Type m] -> Directives -> Schema m
- data Schema m
- type Directives = HashMap Name Directive
- data Directive = Directive (Maybe Text) [DirectiveLocation] Arguments
- data Type m
- description :: forall m. Schema m -> Maybe Text
- query :: forall m. Schema m -> ObjectType m
- mutation :: forall m. Schema m -> Maybe (ObjectType m)
- subscription :: forall m. Schema m -> Maybe (ObjectType m)
- directives :: forall m. Schema m -> Directives
- types :: forall m. Schema m -> HashMap Name (Type m)
- implementations :: forall m. Schema m -> HashMap Name [Type m]
Documentation
:: forall m. 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.
:: forall m. 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).
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.
These are all of the possible kinds of types.
query :: forall m. Schema m -> ObjectType m Source #
Schema query type.
subscription :: forall m. Schema m -> Maybe (ObjectType m) Source #
Schema subscription type.
directives :: forall m. Schema m -> Directives Source #
Schema directive definitions.