graphql-0.6.0.0: Haskell GraphQL implementation

Safe HaskellSafe
LanguageHaskell2010

Language.GraphQL.AST

Description

This module defines an abstract syntax tree for the GraphQL language based on Facebook's GraphQL Specification.

Target AST for Parser.

Synopsis

Documentation

type Alias = Name Source #

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).

data Argument Source #

Single argument.

{
  user(id: 4) {
    name
  }
}

Here "id" is an argument for the field "user" and its value is 4.

Constructors

Argument Name Value 
Instances
Eq Argument Source # 
Instance details

Defined in Language.GraphQL.AST

Show Argument Source # 
Instance details

Defined in Language.GraphQL.AST

data Definition Source #

Top-level definition of a document, either an operation or a fragment.

Instances
Eq Definition Source # 
Instance details

Defined in Language.GraphQL.AST

Show Definition Source # 
Instance details

Defined in Language.GraphQL.AST

data Directive Source #

Directive.

Constructors

Directive Name [Argument] 
Instances
Eq Directive Source # 
Instance details

Defined in Language.GraphQL.AST

Show Directive Source # 
Instance details

Defined in Language.GraphQL.AST

type Document = NonEmpty Definition Source #

GraphQL document.

data Field Source #

Single GraphQL field.

The 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 "user". "id" and "name" don't have any arguments.
Instances
Eq Field Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

(==) :: Field -> Field -> Bool #

(/=) :: Field -> Field -> Bool #

Show Field Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

showsPrec :: Int -> Field -> ShowS #

show :: Field -> String #

showList :: [Field] -> ShowS #

type Name = Text Source #

Name

data NonNullType Source #

Helper type to represent Non-Null types and lists of such types.

Instances
Eq NonNullType Source # 
Instance details

Defined in Language.GraphQL.AST

Show NonNullType Source # 
Instance details

Defined in Language.GraphQL.AST

data ObjectField Source #

Key-value pair.

A list of ObjectFields represents a GraphQL object type.

Constructors

ObjectField Name Value 
Instances
Eq ObjectField Source # 
Instance details

Defined in Language.GraphQL.AST

Show ObjectField Source # 
Instance details

Defined in Language.GraphQL.AST

data OperationType Source #

GraphQL has 3 operation types: queries, mutations and subscribtions.

Currently only queries and mutations are supported.

Constructors

Query 
Mutation 

type SelectionSet = NonEmpty Selection Source #

"Top-level" selection, selection on an operation or fragment.

type SelectionSetOpt = [Selection] Source #

Field selection.

data Type Source #

Type representation.

Instances
Eq Type Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Show Type Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

type TypeCondition = Name Source #

Type condition.

data Value Source #

Input value.

Instances
Eq Value Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Show Value Source # 
Instance details

Defined in Language.GraphQL.AST

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #