Deprecate plural type aliases
Fixes #16. Deprecates: - Language.GraphQL.AST.Arguments - Language.GraphQL.AST.Directives - Language.GraphQL.AST.VariableDefinitions
This commit is contained in:
parent
0d142fb01c
commit
b2a9ec7d82
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
### Deprecated
|
||||||
|
- `Language.GraphQL.AST.Arguments`. Use `[Language.GraphQL.AST.Argument]`
|
||||||
|
instead.
|
||||||
|
- `Language.GraphQL.AST.Directives`. Use `[Language.GraphQL.AST.Directives]`
|
||||||
|
instead.
|
||||||
|
- `Language.GraphQL.AST.VariableDefinitions`. Use
|
||||||
|
`[Language.GraphQL.AST.VariableDefinition]` instead.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Module documentation.
|
||||||
|
|
||||||
## [0.5.0.1] - 2019-09-10
|
## [0.5.0.1] - 2019-09-10
|
||||||
### Added
|
### Added
|
||||||
|
@ -45,18 +45,20 @@ type Document = NonEmpty Definition
|
|||||||
-- * Operations
|
-- * Operations
|
||||||
|
|
||||||
-- | Top-level definition of a document, either an operation or a fragment.
|
-- | Top-level definition of a document, either an operation or a fragment.
|
||||||
data Definition = DefinitionOperation OperationDefinition
|
data Definition
|
||||||
| DefinitionFragment FragmentDefinition
|
= DefinitionOperation OperationDefinition
|
||||||
deriving (Eq, Show)
|
| DefinitionFragment FragmentDefinition
|
||||||
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Operation definition.
|
-- | Operation definition.
|
||||||
data OperationDefinition = OperationSelectionSet SelectionSet
|
data OperationDefinition
|
||||||
| OperationDefinition OperationType
|
= OperationSelectionSet SelectionSet
|
||||||
(Maybe Name)
|
| OperationDefinition OperationType
|
||||||
VariableDefinitions
|
(Maybe Name)
|
||||||
Directives
|
[VariableDefinition]
|
||||||
SelectionSet
|
[Directive]
|
||||||
deriving (Eq, Show)
|
SelectionSet
|
||||||
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | GraphQL has 3 operation types: queries, mutations and subscribtions.
|
-- | GraphQL has 3 operation types: queries, mutations and subscribtions.
|
||||||
--
|
--
|
||||||
@ -73,7 +75,7 @@ type SelectionSetOpt = [Selection]
|
|||||||
|
|
||||||
-- | Single selection element.
|
-- | Single selection element.
|
||||||
data Selection
|
data Selection
|
||||||
= SelectionField Field
|
= SelectionField Field
|
||||||
| SelectionFragmentSpread FragmentSpread
|
| SelectionFragmentSpread FragmentSpread
|
||||||
| SelectionInlineFragment InlineFragment
|
| SelectionInlineFragment InlineFragment
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
@ -82,12 +84,13 @@ data Selection
|
|||||||
|
|
||||||
-- | GraphQL field.
|
-- | GraphQL field.
|
||||||
data Field
|
data Field
|
||||||
= Field (Maybe Alias) Name Arguments Directives SelectionSetOpt
|
= Field (Maybe Alias) Name [Argument] [Directive] SelectionSetOpt
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- * Arguments
|
-- * Arguments
|
||||||
|
|
||||||
-- | Argument list.
|
-- | Argument list.
|
||||||
|
{-# DEPRECATED Arguments "Use [Argument] instead" #-}
|
||||||
type Arguments = [Argument]
|
type Arguments = [Argument]
|
||||||
|
|
||||||
-- | Argument.
|
-- | Argument.
|
||||||
@ -96,15 +99,15 @@ data Argument = Argument Name Value deriving (Eq,Show)
|
|||||||
-- * Fragments
|
-- * Fragments
|
||||||
|
|
||||||
-- | Fragment spread.
|
-- | Fragment spread.
|
||||||
data FragmentSpread = FragmentSpread Name Directives deriving (Eq, Show)
|
data FragmentSpread = FragmentSpread Name [Directive] deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Inline fragment.
|
-- | Inline fragment.
|
||||||
data InlineFragment = InlineFragment (Maybe TypeCondition) Directives SelectionSet
|
data InlineFragment = InlineFragment (Maybe TypeCondition) [Directive] SelectionSet
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Fragment definition.
|
-- | Fragment definition.
|
||||||
data FragmentDefinition
|
data FragmentDefinition
|
||||||
= FragmentDefinition Name TypeCondition Directives SelectionSet
|
= FragmentDefinition Name TypeCondition [Directive] SelectionSet
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
{-# DEPRECATED FragmentName "Use Name instead" #-}
|
{-# DEPRECATED FragmentName "Use Name instead" #-}
|
||||||
@ -135,6 +138,7 @@ data ObjectField = ObjectField Name Value deriving (Eq, Show)
|
|||||||
-- * Variables
|
-- * Variables
|
||||||
|
|
||||||
-- | Variable definition list.
|
-- | Variable definition list.
|
||||||
|
{-# DEPRECATED VariableDefinitions "Use [VariableDefinition] instead" #-}
|
||||||
type VariableDefinitions = [VariableDefinition]
|
type VariableDefinitions = [VariableDefinition]
|
||||||
|
|
||||||
-- | Variable definition.
|
-- | Variable definition.
|
||||||
@ -158,6 +162,7 @@ data NonNullType = NonNullTypeNamed Name
|
|||||||
-- * Directives
|
-- * Directives
|
||||||
|
|
||||||
-- | Directive list.
|
-- | Directive list.
|
||||||
|
{-# DEPRECATED Directives "Use [Directive] instead" #-}
|
||||||
type Directives = [Directive]
|
type Directives = [Directive]
|
||||||
|
|
||||||
-- | Directive.
|
-- | Directive.
|
||||||
|
@ -67,11 +67,11 @@ operationDefinition formatter (OperationDefinition Mutation name vars dirs sels)
|
|||||||
= "mutation " <> node formatter name vars dirs sels
|
= "mutation " <> node formatter name vars dirs sels
|
||||||
|
|
||||||
node :: Formatter
|
node :: Formatter
|
||||||
-> Maybe Name
|
-> Maybe Name
|
||||||
-> VariableDefinitions
|
-> [VariableDefinition]
|
||||||
-> Directives
|
-> [Directive]
|
||||||
-> SelectionSet
|
-> SelectionSet
|
||||||
-> Text
|
-> Text
|
||||||
node formatter name vars dirs sels
|
node formatter name vars dirs sels
|
||||||
= Text.Lazy.fromStrict (fold name)
|
= Text.Lazy.fromStrict (fold name)
|
||||||
<> optempty (variableDefinitions formatter) vars
|
<> optempty (variableDefinitions formatter) vars
|
||||||
@ -170,7 +170,7 @@ directive :: Formatter -> Directive -> Text
|
|||||||
directive formatter (Directive name args)
|
directive formatter (Directive name args)
|
||||||
= "@" <> Text.Lazy.fromStrict name <> optempty (arguments formatter) args
|
= "@" <> Text.Lazy.fromStrict name <> optempty (arguments formatter) args
|
||||||
|
|
||||||
directives :: Formatter -> Directives -> Text
|
directives :: Formatter -> [Directive] -> Text
|
||||||
directives formatter@(Pretty _) = Text.Lazy.cons ' ' . spaces (directive formatter)
|
directives formatter@(Pretty _) = Text.Lazy.cons ' ' . spaces (directive formatter)
|
||||||
directives Minified = spaces (directive Minified)
|
directives Minified = spaces (directive Minified)
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ alias = try $ name <* colon
|
|||||||
|
|
||||||
-- * Arguments
|
-- * Arguments
|
||||||
|
|
||||||
arguments :: Parser Arguments
|
arguments :: Parser [Argument]
|
||||||
arguments = parens $ some argument
|
arguments = parens $ some argument
|
||||||
|
|
||||||
argument :: Parser Argument
|
argument :: Parser Argument
|
||||||
@ -135,7 +135,7 @@ objectField = ObjectField <$> name <* symbol ":" <*> value
|
|||||||
|
|
||||||
-- * Variables
|
-- * Variables
|
||||||
|
|
||||||
variableDefinitions :: Parser VariableDefinitions
|
variableDefinitions :: Parser [VariableDefinition]
|
||||||
variableDefinitions = parens $ some variableDefinition
|
variableDefinitions = parens $ some variableDefinition
|
||||||
|
|
||||||
variableDefinition :: Parser VariableDefinition
|
variableDefinition :: Parser VariableDefinition
|
||||||
@ -164,7 +164,7 @@ nonNullType = NonNullTypeNamed <$> name <* bang
|
|||||||
|
|
||||||
-- * Directives
|
-- * Directives
|
||||||
|
|
||||||
directives :: Parser Directives
|
directives :: Parser [Directive]
|
||||||
directives = some directive
|
directives = some directive
|
||||||
|
|
||||||
directive :: Parser Directive
|
directive :: Parser Directive
|
||||||
|
Loading…
Reference in New Issue
Block a user