| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Language.GraphQL.AST.Core
Description
This is the AST meant to be executed.
Synopsis
- type Alias = Name
- data Argument = Argument Name Value
- type Document = NonEmpty Operation
- data Field = Field (Maybe Alias) Name [Argument] [Selection]
- data Fragment = Fragment TypeCondition (NonEmpty Selection)
- type Name = Text
- data ObjectField = ObjectField Name Value
- data Operation
- data Selection
- type TypeCondition = Name
- data Value
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).
Single argument.
{
user(id: 4) {
name
}
}
Here "id" is an argument for the field "user" and its value is 4.
A single GraphQL field.
Only required property of a field, is its name. Optionally it can also have an alias, arguments or a list of subfields.
Given the following query:
{
zuck: user(id: 4) {
id
name
}
}
- "user", "id" and "name" are field names.
- "user" has two subfields, "id" and "name".
- "zuck" is an alias for "user". "id" and "name" have no aliases.
- "id: 4" is an argument for "name". "id" and "name don't have any arguments.
Represents fragments and inline fragments.
Constructors
| Fragment TypeCondition (NonEmpty Selection) |
data ObjectField Source #
Key-value pair.
A list of ObjectFields represents a GraphQL object type.
Constructors
| ObjectField Name Value |
Instances
| Eq ObjectField Source # | |
Defined in Language.GraphQL.AST.Core | |
| Show ObjectField Source # | |
Defined in Language.GraphQL.AST.Core Methods showsPrec :: Int -> ObjectField -> ShowS # show :: ObjectField -> String # showList :: [ObjectField] -> ShowS # | |
GraphQL has 3 operation types: queries, mutations and subscribtions.
Currently only queries and mutations are supported.
Single selection element.
Constructors
| SelectionFragment Fragment | |
| SelectionField Field |
type TypeCondition = Name Source #
Type condition.
Represents accordingly typed GraphQL values.
Constructors
| ValueInt Int32 | |
| ValueFloat Double | |
| ValueString Text | |
| ValueBoolean Bool | |
| ValueNull | |
| ValueEnum Name | |
| ValueList [Value] | |
| ValueObject [ObjectField] |