2019-12-27 09:14:12 +01:00
|
|
|
-- | Various parts of a GraphQL document can be annotated with directives.
|
|
|
|
-- This module describes locations in a document where directives can appear.
|
2019-12-26 13:00:47 +01:00
|
|
|
module Language.GraphQL.AST.DirectiveLocation
|
2019-12-27 09:14:12 +01:00
|
|
|
( DirectiveLocation(..)
|
|
|
|
, ExecutableDirectiveLocation(..)
|
|
|
|
, TypeSystemDirectiveLocation(..)
|
2019-12-26 13:00:47 +01:00
|
|
|
) where
|
|
|
|
|
2019-12-27 09:14:12 +01:00
|
|
|
-- | All directives can be splitted in two groups: directives used to annotate
|
|
|
|
-- various parts of executable definitions and the ones used in the schema
|
|
|
|
-- definition.
|
2019-12-26 13:00:47 +01:00
|
|
|
data DirectiveLocation
|
|
|
|
= ExecutableDirectiveLocation ExecutableDirectiveLocation
|
|
|
|
| TypeSystemDirectiveLocation TypeSystemDirectiveLocation
|
|
|
|
deriving (Eq, Show)
|
|
|
|
|
2019-12-27 09:14:12 +01:00
|
|
|
-- | Where directives can appear in an executable definition, like a query.
|
2019-12-26 13:00:47 +01:00
|
|
|
data ExecutableDirectiveLocation
|
|
|
|
= Query
|
|
|
|
| Mutation
|
|
|
|
| Subscription
|
|
|
|
| Field
|
|
|
|
| FragmentDefinition
|
|
|
|
| FragmentSpread
|
|
|
|
| InlineFragment
|
|
|
|
deriving (Eq, Show)
|
|
|
|
|
2019-12-27 09:14:12 +01:00
|
|
|
-- | Where directives can appear in a type system definition.
|
2019-12-26 13:00:47 +01:00
|
|
|
data TypeSystemDirectiveLocation
|
|
|
|
= Schema
|
|
|
|
| Scalar
|
|
|
|
| Object
|
|
|
|
| FieldDefinition
|
|
|
|
| ArgumentDefinition
|
|
|
|
| Interface
|
|
|
|
| Union
|
|
|
|
| Enum
|
|
|
|
| EnumValue
|
|
|
|
| InputObject
|
|
|
|
| InputFieldDefinition
|
|
|
|
deriving (Eq, Show)
|