# GraphQL API Reference

I'm a description with a reference to myQuery

##### API Endpoints

    https://example.com/graphql

## Content from file that supports markdown

I am Intro Items content that comes from a `markdown` file!

# Queries

## `contactInfoInputQuery`

##### Description

Without this Query, the `ContactInfoInput` would not be shown

##### Response

Returns a `MyType`

##### Arguments

Name | Description
--- | ---
`input` - `ContactInfoInput` | Without this arg, the `ContactInfoInput` would not be shown

#### Example

##### Query

    query ContactInfoInputQuery($input: ContactInfoInput) {
      contactInfoInputQuery(input: $input) {
        id
        name
        url
        json
        jso
        vd
        byte
        createdAt
        nonRequiredField
        requiredField
        episode
        requiredArrayField
        doubleRequiredArrayField
      }
    }

##### Variables

    {"input": ContactInfoInput}

##### Response

    {
      "data": {
        "contactInfoInputQuery": {
          "id": "idFromDirective",
          "name": "abc123",
          "url": "https://work.com",
          "json": {},
          "jso": {},
          "vd": null,
          "byte": [196, 189, 173, 171, 167, 163],
          "createdAt": "2016-10-07T01:08:03.420Z",
          "nonRequiredField": "Metadata example of `nonRequiredField`",
          "requiredField": "abc123",
          "episode": "NEWHOPE",
          "requiredArrayField": ["xyz789"],
          "doubleRequiredArrayField": ["xyz789"]
        }
      }
    }

Queries

## `enumsQuery`

##### Response

Returns a `String`

##### Arguments

Name | Description
--- | ---
`enums` - `[EpisodeEnum!]!` | Default = `[EMPIRE, JEDI]`
`enum` - `EpisodeEnum!` | enum defaults should get literalized. Default = `EMPIRE`
`ints` - `[Int]` | everything else should get JSON5.parsed. Default = `[1, 2, 3]`

#### Example

##### Query

    query EnumsQuery(
      $enums: [EpisodeEnum!]!,
      $enum: EpisodeEnum!,
      $ints: [Int]
    ) {
      enumsQuery(
        enums: $enums,
        enum: $enum,
        ints: $ints
      )
    }

##### Variables

    {"enums": ["EMPIRE", "JEDI"], "enum": "EMPIRE", "ints": [1, 2, 3]}

##### Response

    {"data": {"enumsQuery": "abc123"}}

Queries

## `filterInputQuery`

##### Description

Without this Query, the `FilterInput` would not be shown

##### Response

Returns a `MyType`

##### Arguments

Name | Description
--- | ---
`filter` - `FilterInput` | Without this Query, the `FilterInput` would not be shown

#### Example

##### Query

    query FilterInputQuery($filter: FilterInput) {
      filterInputQuery(filter: $filter) {
        id
        name
        url
        json
        jso
        vd
        byte
        createdAt
        nonRequiredField
        requiredField
        episode
        requiredArrayField
        doubleRequiredArrayField
      }
    }

##### Variables

    {"filter": FilterInput}

##### Response

    {
      "data": {
        "filterInputQuery": {
          "id": "idFromDirective",
          "name": "abc123",
          "url": "https://work.com",
          "json": {},
          "jso": {},
          "vd": null,
          "byte": [196, 189, 173, 171, 167, 163],
          "createdAt": "2016-10-07T01:08:03.420Z",
          "nonRequiredField": "Metadata example of `nonRequiredField`",
          "requiredField": "xyz789",
          "episode": "NEWHOPE",
          "requiredArrayField": ["abc123"],
          "doubleRequiredArrayField": ["xyz789"]
        }
      }
    }

Queries

## `filterInputQueryWithDefault`

##### Response

Returns a `MyType`

##### Arguments

Name | Description
--- | ---
`filter` - `FilterInput` | Default = `{someField: true, episodeEnums: [EMPIRE, JEDI], episodeEnum: JEDI}`

#### Example

##### Query

    query FilterInputQueryWithDefault($filter: FilterInput) {
      filterInputQueryWithDefault(filter: $filter) {
        id
        name
        url
        json
        jso
        vd
        byte
        createdAt
        nonRequiredField
        requiredField
        episode
        requiredArrayField
        doubleRequiredArrayField
      }
    }

##### Variables

    {
      "filter": {
        "someField": "true",
        "episodeEnums": ["EMPIRE", "JEDI"],
        "episodeEnum": "JEDI"
      }
    }

##### Response

    {
      "data": {
        "filterInputQueryWithDefault": {
          "id": "idFromDirective",
          "name": "abc123",
          "url": "https://work.com",
          "json": {},
          "jso": {},
          "vd": null,
          "byte": [196, 189, 173, 171, 167, 163],
          "createdAt": "2016-10-07T01:08:03.420Z",
          "nonRequiredField": "Metadata example of `nonRequiredField`",
          "requiredField": "xyz789",
          "episode": "NEWHOPE",
          "requiredArrayField": ["abc123"],
          "doubleRequiredArrayField": ["abc123"]
        }
      }
    }

Queries

## `getInts`

##### Response

Returns `[Int]`

#### Example

##### Query

    query GetInts {
      getInts
    }

##### Response

    {"data": {"getInts": [123]}}

Queries

## `myQuery`

`myQuery` is going away

##### Description

`Markdown` and reference interpolation like `[String!]!` are supported

##### Response

Returns a `String`

##### Arguments

Name | Description
--- | ---
`nonReqQueryArg` - `String` | `Markdown` and reference interpolation like `[String!]!` are supported. Default = `"some default string"`
`reqQueryArg` - `String` |
`reqQueryArrayArg` - `[String]!` |
`dblReqQueryArrayArg` - `[String!]!` |

#### Example

##### Query

    query MyQuery(
      $nonReqQueryArg: String,
      $reqQueryArg: String,
      $reqQueryArrayArg: [String]!,
      $dblReqQueryArrayArg: [String!]!
    ) {
      myQuery(
        nonReqQueryArg: $nonReqQueryArg,
        reqQueryArg: $reqQueryArg,
        reqQueryArrayArg: $reqQueryArrayArg,
        dblReqQueryArrayArg: $dblReqQueryArrayArg
      )
    }

##### Variables

    {
      "nonReqQueryArg": "Metadata example of `nonReqQueryArg`",
      "reqQueryArg": "xyz789",
      "reqQueryArrayArg": ["xyz789"],
      "dblReqQueryArrayArg": ["abc123"]
    }

##### Response

    {"data": {"myQuery": "xyz789"}}

Queries

## `myTypes`

##### Response

Returns `[MyType]`

#### Example

##### Query

    query MyTypes {
      myTypes {
        id
        name
        url
        json
        jso
        vd
        byte
        createdAt
        nonRequiredField
        requiredField
        episode
        requiredArrayField
        doubleRequiredArrayField
      }
    }

##### Response

    {
      "data": {
        "myTypes": [
          {
            "id": "idFromDirective",
            "name": "xyz789",
            "url": "https://work.com",
            "json": {},
            "jso": {},
            "vd": null,
            "byte": [196, 189, 173, 171, 167, 163],
            "createdAt": "2016-10-07T01:08:03.420Z",
            "nonRequiredField": "Metadata example of `nonRequiredField`",
            "requiredField": "abc123",
            "episode": "NEWHOPE",
            "requiredArrayField": ["xyz789"],
            "doubleRequiredArrayField": [
              "abc123"
            ]
          }
        ]
      }
    }

Queries

## `nodeQuery`

##### Response

Returns a `Node`

##### Arguments

Name | Description
--- | ---
`id` - `String!` |

#### Example

##### Query

    query NodeQuery($id: String!) {
      nodeQuery(id: $id) {
        id
      }
    }

##### Variables

    {"id": "abc123"}

##### Response

    {"data": {"nodeQuery": {"id": "abc123"}}}

Queries

## `optionalsQuery`

##### Description

I'm the optionals query

##### Response

Returns `[String]`

##### Arguments

Name | Description
--- | ---
`optionalArg` - `[String]` |

#### Example

##### Query

    query OptionalsQuery($optionalArg: [String]) {
      optionalsQuery(optionalArg: $optionalArg)
    }

##### Variables

    {"optionalArg": ["xyz789"]}

##### Response

    {"data": {"optionalsQuery": ["abc123"]}}

Queries

## `requiredsQuery`

##### Response

Returns `[String!]!`

##### Arguments

Name | Description
--- | ---
`dblReqArg` - `[String!]!` |

#### Example

##### Query

    query RequiredsQuery($dblReqArg: [String!]!) {
      requiredsQuery(dblReqArg: $dblReqArg)
    }

##### Variables

    {"dblReqArg": ["abc123"]}

##### Response

    {"data": {"requiredsQuery": ["abc123"]}}

Queries

## `simpleTypes`

##### Description

I return a list of the SimpleType Union

##### Response

Returns `[SimpleTypes]`

#### Example

##### Query

    query SimpleTypes {
      simpleTypes {
        ... on SimpleTypeOne {
          ...SimpleTypeOneFragment
        }
        ... on SimpleTypeTwo {
          ...SimpleTypeTwoFragment
        }
        ... on MyType {
          ...MyTypeFragment
        }
      }
    }

##### Response

    {"data": {"simpleTypes": [SimpleTypeOne]}}

Queries

## `stringThing`

##### Description

This Query has the same name as a Mutation

##### Response

Returns a `String`

#### Example

##### Query

    query StringThing {
      stringThing
    }

##### Response

    {"data": {"stringThing": "xyz789"}}

# Mutations

## `myMutation`

##### Description

`Markdown` and reference interpolation like `[String!]!` are supported

##### Response

Returns a `String`

##### Arguments

Name | Description
--- | ---
`nonReqMutationArg` - `String` | `Markdown` and reference interpolation like `[String!]!` are supported. Default = `"some default string"`
`reqMutationArg` - `String!` |
`reqMutationArrayArg` - `[String]!` |
`dblReqMutationArrayArg` - `[String!]!` |

#### Example

##### Query

    mutation MyMutation(
      $nonReqMutationArg: String,
      $reqMutationArg: String!,
      $reqMutationArrayArg: [String]!,
      $dblReqMutationArrayArg: [String!]!
    ) {
      myMutation(
        nonReqMutationArg: $nonReqMutationArg,
        reqMutationArg: $reqMutationArg,
        reqMutationArrayArg: $reqMutationArrayArg,
        dblReqMutationArrayArg: $dblReqMutationArrayArg
      )
    }

##### Variables

    {
      "nonReqMutationArg": "some default string",
      "reqMutationArg": "xyz789",
      "reqMutationArrayArg": ["abc123"],
      "dblReqMutationArrayArg": ["xyz789"]
    }

##### Response

    {"data": {"myMutation": "abc123"}}

Mutations

## `stringThing`

##### Description

This Mutation has the same name as a Query

##### Response

Returns a `String`

##### Arguments

Name | Description
--- | ---
`anArgument` - `String` |

#### Example

##### Query

    mutation StringThing($anArgument: String) {
      stringThing(anArgument: $anArgument)
    }

##### Variables

    {"anArgument": "abc123"}

##### Response

    {"data": {"stringThing": "abc123"}}

# Subscriptions

## `myTypeUpdatedSubscription`

##### Description

The `myTypeUpdatedSubscription`, baby!

##### Response

Returns a `MyType!`

##### Arguments

Name | Description
--- | ---
`input` - `ID` |

#### Example

##### Query

    subscription MyTypeUpdatedSubscription($input: ID) {
      myTypeUpdatedSubscription(input: $input) {
        id
        name
        url
        json
        jso
        vd
        byte
        createdAt
        nonRequiredField
        requiredField
        episode
        requiredArrayField
        doubleRequiredArrayField
      }
    }

##### Variables

    {"input": 4}

##### Response

    {
      "data": {
        "myTypeUpdatedSubscription": {
          "id": "idFromDirective",
          "name": "abc123",
          "url": "https://work.com",
          "json": {},
          "jso": {},
          "vd": null,
          "byte": [196, 189, 173, 171, 167, 163],
          "createdAt": "2016-10-07T01:08:03.420Z",
          "nonRequiredField": "Metadata example of `nonRequiredField`",
          "requiredField": "xyz789",
          "episode": "NEWHOPE",
          "requiredArrayField": ["xyz789"],
          "doubleRequiredArrayField": ["xyz789"]
        }
      }
    }

# Types

## AddressInput

##### Description

AddresInput description

##### Fields

Input Field | Description
--- | ---
`lat` - `String` |
`lon` - `String` |
`planet` - `String` |

##### Example

    {
      "lat": "abc123",
      "lon": "abc123",
      "planet": "abc123"
    }

Types

## Boolean

##### Description

The `Boolean` scalar type represents `true` or `false`.

##### Example

    true

Types

## Byte

##### Example

    [196, 189, 173, 171, 167, 163]

Types

## ContactInfoInput

##### Description

ContactInfoInput description

##### Fields

Input Field | Description
--- | ---
`email` - `String` |
`address` - `AddressInput` | Without this InputField, the `AddressInput` would not be shown. Default = `{planet: "Earth"}`
`phoneNumber` - `PhoneNumber` |

##### Example

    {
      "email": "xyz789",
      "address": AddressInput,
      "phoneNumber": "+17895551234"
    }

Types

## DateTime

##### Description

This is a `DateTime` scalar

##### Example

    "2016-10-07T01:08:03.420Z"

Types

## EpisodeEnum

##### Description

These are very important `enum`s. `Markdown` and reference interpolation like `[String!]!` are supported

##### Values

Enum Value | Description
--- | ---
`NEWHOPE` | Who is Luke? `Markdown` and reference interpolation like `[String!]!` are supported `NEWHOPE` is going away
`JEDI` | Who are the Ewoks?

##### Example

    "NEWHOPE"

Types

## FilterInput

##### Description

An Input Type for filtering things. `Markdown` and reference interpolation like `[String!]!` are supported

##### Fields

Input Field | Description
--- | ---
`someField` - `Boolean` | Comment for someField. `Markdown` and reference interpolation like `[String!]!` are supported. Default = `false` `someField` is going away
`anotherField` - `String` | Comment for anotherField
`episodeEnums` - `[EpisodeEnum!]` | Comment for episodeEnums. Default = `[EMPIRE, JEDI]`
`episodeEnum` - `EpisodeEnum` |

##### Example

    {
      "someField": true,
      "anotherField": "Metadata example of `anotherField`",
      "episodeEnums": ["EMPIRE"],
      "episodeEnum": "NEWHOPE"
    }

Types

## ID

##### Description

The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.

##### Example

    "4"

Types

## Int

##### Description

The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

##### Example

    987

Types

## JSON

##### Example

    {}

Types

## JSONObject

##### Example

    {}

Types

## MyInterface

##### Description

A simple Interface

##### Fields

Field Name | Description
--- | ---
`id` - `String!` |

##### Possible Types

MyInterface Types
`MyType`

##### Example

    {"id": "exampleFromMetadataJson"}

Types

## MyType

##### Description

`Markdown` and reference interpolation like `[String!]!` and `myQuery` and `myMutation` are supported

##### Fields

Field Name | Description
--- | ---
`id` - `String!` | I am an ID that will have my example value specified by the `@spectaql` directive
`name` - `String!` |
`url` - `URL` |
`json` - `JSON` |
`jso` - `JSONObject` |
`vd` - `Void` |
`byte` - `Byte` |
`createdAt` - `DateTime` |
`nonRequiredField` - `String` | `Markdown` and reference interpolation like `[String!]!` are supported
##### Arguments ###### `nonRequiredArg` - `String` `Markdown` and reference interpolation like `[String!]!` are supported ###### `reqArg` - `String!` ###### `reqArrayArg` - `[String]!` ###### `dblReqArrayArg` - `[String!]!`
`requiredField` - `String!` | `requiredField` is going away
`episode` - `EpisodeEnum!` |
`requiredArrayField` - `[String]!` |
`doubleRequiredArrayField` - `[String!]!` |

##### Example

    {
      "id": "idFromDirective",
      "name": "abc123",
      "url": "https://work.com",
      "json": {},
      "jso": {},
      "vd": null,
      "byte": [196, 189, 173, 171, 167, 163],
      "createdAt": "2016-10-07T01:08:03.420Z",
      "nonRequiredField": "Metadata example of `nonRequiredField`",
      "requiredField": "abc123",
      "episode": "NEWHOPE",
      "requiredArrayField": ["xyz789"],
      "doubleRequiredArrayField": ["xyz789"]
    }

Types

## Node

##### Description

Anything with an ID can be a node

##### Fields

Field Name | Description
--- | ---
`id` - `String!` | A unique identifier

##### Possible Types

Node Types
`SimpleTypeOne`

##### Example

    {"id": "xyz789"}

Types

## PhoneNumber

##### Description

This is a Phone

##### Example

    "+17895551234"

Types

## SimpleTypeOne

##### Description

`Markdown` and reference interpolation like `[String!]!` are supported

##### Fields

Field Name | Description
--- | ---
`id` - `String!` |
`myType` - `[MyType!]!` | `Markdown` and reference interpolation like `[String!]!` are supported

##### Example

    {"id": "123", "myType": [{"id": "myTypeId", "name": "myTypeName"}]}

Types

## SimpleTypeTwo

##### Fields

Field Name | Description
--- | ---
`simpleTypeTwoFieldOne` - `String` |
`simpleTypeTwoFieldTwo` - `String` |

##### Example

    {"simpleTypeTwoFieldOne": "42", "simpleTypeTwoFieldTwo": "SomeIdValue"}

Types

## SimpleTypes

##### Description

A Union of `SimpleTypeOne` and `SimpleTypeTwo`. `Markdown` and reference interpolation like `[String!]!` are supported

##### Types

Union Types
`SimpleTypeOne`
`SimpleTypeTwo`
`MyType`

##### Example

    SimpleTypeOne

Types

## String

##### Description

The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

##### Example

    "abc123"

Types

## URL

##### Example

    "https://work.com"

Types

## Void

Documentation by Anvil SpectaQL