diff options
Diffstat (limited to 'src/Language/GraphQL/Type')
| -rw-r--r-- | src/Language/GraphQL/Type/In.hs | 1 | ||||
| -rw-r--r-- | src/Language/GraphQL/Type/Internal.hs | 6 | ||||
| -rw-r--r-- | src/Language/GraphQL/Type/Schema.hs | 8 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/Language/GraphQL/Type/In.hs b/src/Language/GraphQL/Type/In.hs index c777e69..bd78c8c 100644 --- a/src/Language/GraphQL/Type/In.hs +++ b/src/Language/GraphQL/Type/In.hs @@ -74,6 +74,7 @@ instance Show Type where -- | Field argument definition. data Argument = Argument (Maybe Text) Type (Maybe Definition.Value) + deriving Eq -- | Field argument definitions. type Arguments = HashMap Name Argument diff --git a/src/Language/GraphQL/Type/Internal.hs b/src/Language/GraphQL/Type/Internal.hs index ce3b121..a126782 100644 --- a/src/Language/GraphQL/Type/Internal.hs +++ b/src/Language/GraphQL/Type/Internal.hs @@ -48,7 +48,11 @@ data Type m deriving Eq -- | Directive definition. -data Directive = Directive (Maybe Text) [DirectiveLocation] In.Arguments +-- +-- A definition consists of an optional description, arguments, whether the +-- directive is repeatable, and the allowed directive locations. +data Directive = Directive (Maybe Text) In.Arguments Bool [DirectiveLocation] + deriving Eq -- | Directive definitions. type Directives = HashMap Full.Name Directive diff --git a/src/Language/GraphQL/Type/Schema.hs b/src/Language/GraphQL/Type/Schema.hs index 27053f2..6084a77 100644 --- a/src/Language/GraphQL/Type/Schema.hs +++ b/src/Language/GraphQL/Type/Schema.hs @@ -88,13 +88,13 @@ schemaWithTypes description' queryRoot mutationRoot subscriptionRoot types' dire , ("specifiedBy", specifiedByDirective) ] includeDirective = - Directive includeDescription skipIncludeLocations includeArguments + Directive includeDescription includeArguments False skipIncludeLocations includeArguments = HashMap.singleton "if" $ In.Argument (Just "Included when true.") ifType Nothing includeDescription = Just "Directs the executor to include this field or fragment only when the \ \`if` argument is true." - skipDirective = Directive skipDescription skipIncludeLocations skipArguments + skipDirective = Directive skipDescription skipArguments False skipIncludeLocations skipArguments = HashMap.singleton "if" $ In.Argument (Just "skipped when true.") ifType Nothing ifType = In.NonNullScalarType Definition.boolean @@ -107,7 +107,7 @@ schemaWithTypes description' queryRoot mutationRoot subscriptionRoot types' dire , ExecutableDirectiveLocation DirectiveLocation.InlineFragment ] deprecatedDirective = - Directive deprecatedDescription deprecatedLocations deprecatedArguments + Directive deprecatedDescription deprecatedArguments False deprecatedLocations reasonDescription = Just "Explains why this element was deprecated, usually also including a \ \suggestion for how to access supported similar data. Formatted using \ @@ -125,7 +125,7 @@ schemaWithTypes description' queryRoot mutationRoot subscriptionRoot types' dire , TypeSystemDirectiveLocation DirectiveLocation.EnumValue ] specifiedByDirective = - Directive specifiedByDescription specifiedByLocations specifiedByArguments + Directive specifiedByDescription specifiedByArguments False specifiedByLocations urlDescription = Just "The URL that specifies the behavior of this scalar." specifiedByArguments = HashMap.singleton "url" |
