Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module defines an abstract syntax tree for the GraphQL
language based on
Facebook's GraphQL Specification.
Target AST for Parser.
Synopsis
- type Alias = Name
- data Argument = Argument Name Value
- type Arguments = [Argument]
- data Definition
- data Directive = Directive Name [Argument]
- type Directives = [Directive]
- type Document = NonEmpty Definition
- data Field = Field (Maybe Alias) Name Arguments Directives SelectionSetOpt
- data FragmentDefinition = FragmentDefinition Name TypeCondition Directives SelectionSet
- type FragmentName = Name
- data FragmentSpread = FragmentSpread Name Directives
- data InlineFragment = InlineFragment (Maybe TypeCondition) Directives SelectionSet
- type Name = Text
- data NonNullType
- data ObjectField = ObjectField Name Value
- data OperationDefinition
- data OperationType
- data Selection
- type SelectionSet = NonEmpty Selection
- type SelectionSetOpt = [Selection]
- data Type
- type TypeCondition = Name
- data Value
- data VariableDefinition = VariableDefinition Name Type (Maybe Value)
- type VariableDefinitions = [VariableDefinition]
Documentation
Alternative field name.
{ smallPic: profilePic(size: 64) bigPic: profilePic(size: 1024) }
Here "smallPic" and "bigPic" are aliases for the same field, "profilePic", used to distinquish between profile pictures with different arguments (sizes).
Argument.
data Definition Source #
Top-level definition of a document, either an operation or a fragment.
Instances
Eq Definition Source # | |
Defined in Language.GraphQL.AST (==) :: Definition -> Definition -> Bool # (/=) :: Definition -> Definition -> Bool # | |
Show Definition Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> Definition -> ShowS # show :: Definition -> String # showList :: [Definition] -> ShowS # |
type Directives = [Directive] Source #
Directive list.
type Document = NonEmpty Definition Source #
GraphQL document.
GraphQL field.
data FragmentDefinition Source #
Fragment definition.
Instances
Eq FragmentDefinition Source # | |
Defined in Language.GraphQL.AST (==) :: FragmentDefinition -> FragmentDefinition -> Bool # (/=) :: FragmentDefinition -> FragmentDefinition -> Bool # | |
Show FragmentDefinition Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> FragmentDefinition -> ShowS # show :: FragmentDefinition -> String # showList :: [FragmentDefinition] -> ShowS # |
type FragmentName = Name Source #
Deprecated: Use Name instead
data FragmentSpread Source #
Fragment spread.
Instances
Eq FragmentSpread Source # | |
Defined in Language.GraphQL.AST (==) :: FragmentSpread -> FragmentSpread -> Bool # (/=) :: FragmentSpread -> FragmentSpread -> Bool # | |
Show FragmentSpread Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> FragmentSpread -> ShowS # show :: FragmentSpread -> String # showList :: [FragmentSpread] -> ShowS # |
data InlineFragment Source #
Inline fragment.
Instances
Eq InlineFragment Source # | |
Defined in Language.GraphQL.AST (==) :: InlineFragment -> InlineFragment -> Bool # (/=) :: InlineFragment -> InlineFragment -> Bool # | |
Show InlineFragment Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> InlineFragment -> ShowS # show :: InlineFragment -> String # showList :: [InlineFragment] -> ShowS # |
data NonNullType Source #
Helper type to represent Non-Null types and lists of such types.
Instances
Eq NonNullType Source # | |
Defined in Language.GraphQL.AST (==) :: NonNullType -> NonNullType -> Bool # (/=) :: NonNullType -> NonNullType -> Bool # | |
Show NonNullType Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> NonNullType -> ShowS # show :: NonNullType -> String # showList :: [NonNullType] -> ShowS # |
data ObjectField Source #
Key-value pair.
A list of ObjectField
s represents a GraphQL object type.
Instances
Eq ObjectField Source # | |
Defined in Language.GraphQL.AST (==) :: ObjectField -> ObjectField -> Bool # (/=) :: ObjectField -> ObjectField -> Bool # | |
Show ObjectField Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> ObjectField -> ShowS # show :: ObjectField -> String # showList :: [ObjectField] -> ShowS # |
data OperationDefinition Source #
Operation definition.
OperationSelectionSet SelectionSet | |
OperationDefinition OperationType (Maybe Name) VariableDefinitions Directives SelectionSet |
Instances
Eq OperationDefinition Source # | |
Defined in Language.GraphQL.AST (==) :: OperationDefinition -> OperationDefinition -> Bool # (/=) :: OperationDefinition -> OperationDefinition -> Bool # | |
Show OperationDefinition Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> OperationDefinition -> ShowS # show :: OperationDefinition -> String # showList :: [OperationDefinition] -> ShowS # |
data OperationType Source #
GraphQL has 3 operation types: queries, mutations and subscribtions.
Currently only queries and mutations are supported.
Instances
Eq OperationType Source # | |
Defined in Language.GraphQL.AST (==) :: OperationType -> OperationType -> Bool # (/=) :: OperationType -> OperationType -> Bool # | |
Show OperationType Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> OperationType -> ShowS # show :: OperationType -> String # showList :: [OperationType] -> ShowS # |
type SelectionSet = NonEmpty Selection Source #
"Top-level" selection, selection on a operation.
type SelectionSetOpt = [Selection] Source #
Type representation.
type TypeCondition = Name Source #
Type condition.
Input value.
data VariableDefinition Source #
Variable definition.
Instances
Eq VariableDefinition Source # | |
Defined in Language.GraphQL.AST (==) :: VariableDefinition -> VariableDefinition -> Bool # (/=) :: VariableDefinition -> VariableDefinition -> Bool # | |
Show VariableDefinition Source # | |
Defined in Language.GraphQL.AST showsPrec :: Int -> VariableDefinition -> ShowS # show :: VariableDefinition -> String # showList :: [VariableDefinition] -> ShowS # |
type VariableDefinitions = [VariableDefinition] Source #
Variable definition list.