graphql-0.5.0.1: Haskell GraphQL implementation

Safe HaskellSafe
LanguageHaskell2010

Language.GraphQL.AST.Core

Description

This is the AST meant to be executed.

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

Show Argument Source # 
Instance details

Defined in Language.GraphQL.AST.Core

type Document = NonEmpty Operation Source #

GraphQL document is a non-empty list of operations.

data Field Source #

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.

Constructors

Field (Maybe Alias) Name [Argument] [Field] 
Instances
Eq Field Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Methods

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

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

Show Field Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Methods

showsPrec :: Int -> Field -> ShowS #

show :: Field -> String #

showList :: [Field] -> ShowS #

type Name = Text Source #

Name

data ObjectField Source #

Key-value pair.

A list of ObjectFields represents a GraphQL object type.

Constructors

ObjectField Name Value 

data Operation Source #

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

Currently only queries and mutations are supported.

Instances
Eq Operation Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Show Operation Source # 
Instance details

Defined in Language.GraphQL.AST.Core

data Value Source #

Represents accordingly typed GraphQL values.

Instances
Eq Value Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Methods

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

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

Show Value Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

IsString Value Source # 
Instance details

Defined in Language.GraphQL.AST.Core

Methods

fromString :: String -> Value #