Full Code of graphql-go/graphql for AI

master d5f8f3c54f31 cached
137 files
1.1 MB
321.7k tokens
1839 symbols
1 requests
Download .txt
Showing preview only (1,191K chars total). Download the full file or copy to clipboard to get everything.
Repository: graphql-go/graphql
Branch: master
Commit: d5f8f3c54f31
Files: 137
Total size: 1.1 MB

Directory structure:
gitextract_a97o64la/

├── .circleci/
│   └── config.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── abstract_test.go
├── benchutil/
│   ├── list_schema.go
│   └── wide_schema.go
├── definition.go
├── definition_test.go
├── directives.go
├── directives_test.go
├── enum_type_test.go
├── examples/
│   ├── concurrent-resolvers/
│   │   └── main.go
│   ├── context/
│   │   └── main.go
│   ├── crud/
│   │   ├── Readme.md
│   │   └── main.go
│   ├── custom-scalar-type/
│   │   └── main.go
│   ├── hello-world/
│   │   └── main.go
│   ├── http/
│   │   ├── data.json
│   │   └── main.go
│   ├── http-post/
│   │   └── main.go
│   ├── httpdynamic/
│   │   ├── README.md
│   │   ├── data.json
│   │   └── main.go
│   ├── modify-context/
│   │   └── main.go
│   ├── sql-nullstring/
│   │   ├── README.md
│   │   └── main.go
│   ├── star-wars/
│   │   └── main.go
│   └── todo/
│       ├── README.md
│       ├── main.go
│       ├── schema/
│       │   └── schema.go
│       └── static/
│           ├── assets/
│           │   ├── css/
│           │   │   └── style.css
│           │   └── js/
│           │       └── app.js
│           └── index.html
├── executor.go
├── executor_resolve_test.go
├── executor_schema_test.go
├── executor_test.go
├── extensions.go
├── extensions_test.go
├── go.mod
├── gqlerrors/
│   ├── error.go
│   ├── formatted.go
│   ├── located.go
│   ├── sortutil.go
│   └── syntax.go
├── graphql.go
├── graphql_bench_test.go
├── graphql_test.go
├── introspection.go
├── introspection_test.go
├── kitchen-sink.graphql
├── language/
│   ├── ast/
│   │   ├── arguments.go
│   │   ├── definitions.go
│   │   ├── directives.go
│   │   ├── document.go
│   │   ├── location.go
│   │   ├── name.go
│   │   ├── node.go
│   │   ├── selections.go
│   │   ├── type_definitions.go
│   │   ├── types.go
│   │   └── values.go
│   ├── kinds/
│   │   └── kinds.go
│   ├── lexer/
│   │   ├── lexer.go
│   │   └── lexer_test.go
│   ├── location/
│   │   └── location.go
│   ├── parser/
│   │   ├── parser.go
│   │   ├── parser_test.go
│   │   └── schema_parser_test.go
│   ├── printer/
│   │   ├── printer.go
│   │   ├── printer_test.go
│   │   └── schema_printer_test.go
│   ├── source/
│   │   └── source.go
│   ├── typeInfo/
│   │   └── type_info.go
│   └── visitor/
│       ├── visitor.go
│       └── visitor_test.go
├── lists_test.go
├── located.go
├── mutations_test.go
├── nonnull_test.go
├── quoted_or_list_internal_test.go
├── race_test.go
├── rules.go
├── rules_arguments_of_correct_type_test.go
├── rules_default_values_of_correct_type_test.go
├── rules_fields_on_correct_type_test.go
├── rules_fragments_on_composite_types_test.go
├── rules_known_argument_names_test.go
├── rules_known_directives_rule_test.go
├── rules_known_fragment_names_test.go
├── rules_known_type_names_test.go
├── rules_lone_anonymous_operation_rule_test.go
├── rules_no_fragment_cycles_test.go
├── rules_no_undefined_variables_test.go
├── rules_no_unused_fragments_test.go
├── rules_no_unused_variables_test.go
├── rules_overlapping_fields_can_be_merged.go
├── rules_overlapping_fields_can_be_merged_test.go
├── rules_possible_fragment_spreads_test.go
├── rules_provided_non_null_arguments_test.go
├── rules_scalar_leafs_test.go
├── rules_unique_argument_names_test.go
├── rules_unique_fragment_names_test.go
├── rules_unique_input_field_names_test.go
├── rules_unique_operation_names_test.go
├── rules_unique_variable_names_test.go
├── rules_variables_are_input_types_test.go
├── rules_variables_in_allowed_position_test.go
├── scalars.go
├── scalars_parse_test.go
├── scalars_serialization_test.go
├── scalars_test.go
├── schema-all-descriptions.graphql
├── schema-kitchen-sink.graphql
├── schema.go
├── subscription.go
├── subscription_test.go
├── suggested_list_internal_test.go
├── testutil/
│   ├── introspection_query.go
│   ├── rules_test_harness.go
│   ├── subscription.go
│   ├── testutil.go
│   └── testutil_test.go
├── type_comparators_internal_test.go
├── type_info.go
├── types.go
├── union_interface_test.go
├── util.go
├── util_test.go
├── validation_test.go
├── validator.go
├── validator_test.go
├── values.go
├── values_test.go
└── variables_test.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .circleci/config.yml
================================================
test_with_go_modules: &test_with_go_modules
  steps:
    - checkout
    - run: go test ./...
    - run: go vet ./...

test_without_go_modules: &test_without_go_modules
  working_directory: /go/src/github.com/graphql-go/graphql
  steps:
    - checkout
    - run: go get -v -t -d ./...
    - run: go test ./...
    - run: go vet ./...

defaults: &defaults
  <<: *test_with_go_modules

version: 2
jobs:
  golang:1.8.7:
    <<: *test_without_go_modules
    docker:
      - image: circleci/golang:1.8.7
  golang:1.9.7:
    <<: *test_without_go_modules
    docker:
      - image: circleci/golang:1.9.7
  golang:1.11:
    <<: *defaults
    docker:
      - image: circleci/golang:1.11
  golang:latest:
    <<: *defaults
    docker:
      - image: circleci/golang:latest
  coveralls:
    docker:
      - image: circleci/golang:latest
    steps:
      - checkout
      - run: go get github.com/mattn/goveralls
      - run: go test -v -cover -race -coverprofile=coverage.out
      - run: /go/bin/goveralls -coverprofile=coverage.out -service=circle-ci -repotoken $COVERALLS_TOKEN

workflows:
  version: 2
  build:
    jobs:
      - golang:1.8.7
      - golang:1.9.7
      - golang:1.11
      - golang:latest
      - coveralls


================================================
FILE: .gitignore
================================================
.DS_Store
.idea

================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to graphql

This document is based on the [Node.js contribution guidelines](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md)

## Chat room

[![Join the chat at https://gitter.im/graphql-go/graphql](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/graphql-go/graphql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Feel free to participate in the chat room for informal discussions and queries.

Just drop by and say hi!

## Issue Contributions

When opening new issues or commenting on existing issues on this repository
please make sure discussions are related to concrete technical issues with the
`graphql` implementation.

## Code Contributions

The `graphql` project welcomes new contributors.

This document will guide you through the contribution process.

What do you want to contribute?

- I want to otherwise correct or improve the docs or examples
- I want to report a bug
- I want to add some feature or functionality to an existing hardware platform
- I want to add support for a new hardware platform

Descriptions for each of these will eventually be provided below.

## General Guidelines
* Reading up on [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments) would be a great start.
* Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in the [chat room](#chat-room).
* We will look at the patch, test it out, and give you feedback.
* Avoid doing minor whitespace changes, renaming, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done separately.
* Take care to maintain the existing coding style.
* Always `golint` and `go fmt` your code.
* Add unit tests for any new or changed functionality, especially for public APIs.
* Run `go test` before submitting a PR.
* For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git


## Creating Pull Requests
Because `graphql` makes use of self-referencing import paths, you will want
to implement the local copy of your fork as a remote on your copy of the
original `graphql` repo. Katrina Owen has [an excellent post on this workflow](https://splice.com/blog/contributing-open-source-git-repositories-go/).

The basics are as follows:

1. Fork the project via the GitHub UI

2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote:

```bash
$ go get github.com/graphql-go/graphql
$ cd $GOPATH/src/github.com/graphql-go/graphql
$ git remote rename origin upstream
$ git remote add origin git@github.com/YOUR_GITHUB_NAME/graphql
```
All import paths should now work fine assuming that you've got the
proper branch checked out.


## Landing Pull Requests
(This is for committers only. If you are unsure whether you are a committer, you are not.)

1. Set the contributor's fork as an upstream on your checkout

   ```git remote add contrib1 https://github.com/contrib1/graphql```

2. Fetch the contributor's repo

   ```git fetch contrib1```

3. Checkout a copy of the PR branch

   ```git checkout pr-1234 --track contrib1/branch-for-pr-1234```

4. Review the PR as normal

5. Land when you're ready via the GitHub UI

## Developer's Certificate of Origin 1.0

By making a contribution to this project, I certify that:

* (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or
* (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
* (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.


## Code of Conduct

This Code of Conduct is adapted from [Rust's wonderful
CoC](http://www.rust-lang.org/conduct.html).

* We are committed to providing a friendly, safe and welcoming
environment for all, regardless of gender, sexual orientation,
disability, ethnicity, religion, or similar personal characteristic.
* Please avoid using overtly sexual nicknames or other nicknames that
might detract from a friendly, safe and welcoming environment for
all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every
design or implementation choice carries a trade-off and numerous
costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid
ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass
anyone.  That is not welcome behaviour. We interpret the term
"harassment" as including the definition in the [Citizen Code of
Conduct](http://citizencodeofconduct.org/); if you have any lack of
clarity about what might be included in that concept, please read
their definition. In particular, we don't tolerate behavior that
excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if
you feel you have been or are being harassed or made uncomfortable
by a community member, please contact one of the channel ops or any
of the TC members immediately with a capture (log, photo, email) of
the harassment if possible.  Whether you're a regular contributor or
a newcomer, we care about making this community a safe place for you
and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other
attention-stealing behaviour is not welcome.
* Avoid the use of personal pronouns in code comments or
documentation. There is no need to address persons when explaining
code (e.g. "When the developer")


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015 Chris Ramón

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# graphql [![CircleCI](https://circleci.com/gh/graphql-go/graphql/tree/master.svg?style=svg)](https://circleci.com/gh/graphql-go/graphql/tree/master) [![Go Reference](https://pkg.go.dev/badge/github.com/graphql-go/graphql.svg)](https://pkg.go.dev/github.com/graphql-go/graphql) [![Coverage Status](https://coveralls.io/repos/github/graphql-go/graphql/badge.svg?branch=master)](https://coveralls.io/github/graphql-go/graphql?branch=master) [![Join the chat at https://gitter.im/graphql-go/graphql](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/graphql-go/graphql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

An implementation of GraphQL in Go. Follows the official reference implementation [`graphql-js`](https://github.com/graphql/graphql-js).

Supports: queries, mutations & subscriptions.

### Documentation

godoc: https://pkg.go.dev/github.com/graphql-go/graphql

### Contribute Back

Friendly reminder links are available in case you would like to contribute back into our commitment with Go and open-source.

| Author        |  PayPal Link  |
|:-------------:|:-------------:|
| [Hafiz Ismail](https://github.com/sogko) | Not available yet. |
| [Chris Ramón](https://github.com/chris-ramon) | https://www.paypal.com/donate/?hosted_button_id=WHUQQYEMTRQBJ |

### Getting Started

To install the library, run:
```bash
go get github.com/graphql-go/graphql
```

The following is a simple example which defines a schema with a single `hello` string-type field and a `Resolve` method which returns the string `world`. A GraphQL query is performed against this schema with the resulting output printed in JSON format.

```go
package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
)

func main() {
	// Schema
	fields := graphql.Fields{
		"hello": &graphql.Field{
			Type: graphql.String,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				return "world", nil
			},
		},
	}
	rootQuery := graphql.ObjectConfig{Name: "RootQuery", Fields: fields}
	schemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)}
	schema, err := graphql.NewSchema(schemaConfig)
	if err != nil {
		log.Fatalf("failed to create new schema, error: %v", err)
	}

	// Query
	query := `
		{
			hello
		}
	`
	params := graphql.Params{Schema: schema, RequestString: query}
	r := graphql.Do(params)
	if len(r.Errors) > 0 {
		log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors)
	}
	rJSON, _ := json.Marshal(r)
	fmt.Printf("%s \n", rJSON) // {"data":{"hello":"world"}}
}
```
For more complex examples, refer to the [examples/](https://github.com/graphql-go/graphql/tree/master/examples/) directory and [graphql_test.go](https://github.com/graphql-go/graphql/blob/master/graphql_test.go).

### Third Party Libraries
| Name          | Author        | Description  |
|:-------------:|:-------------:|:------------:|
| [graphql-go-handler](https://github.com/graphql-go/graphql-go-handler) | [Hafiz Ismail](https://github.com/sogko) | Middleware to handle GraphQL queries through HTTP requests. |
| [graphql-relay-go](https://github.com/graphql-go/graphql-relay-go) | [Hafiz Ismail](https://github.com/sogko) | Lib to construct a graphql-go server supporting react-relay. |
| [golang-relay-starter-kit](https://github.com/sogko/golang-relay-starter-kit) | [Hafiz Ismail](https://github.com/sogko) | Barebones starting point for a Relay application with Golang GraphQL server. |
| [dataloader](https://github.com/nicksrandall/dataloader) | [Nick Randall](https://github.com/nicksrandall) | [DataLoader](https://github.com/facebook/dataloader) implementation in Go. |

### Blog Posts
- [Golang + GraphQL + Relay](https://wehavefaces.net/learn-golang-graphql-relay-1-e59ea174a902)



================================================
FILE: abstract_test.go
================================================
package graphql_test

import (
	"reflect"
	"testing"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/gqlerrors"
	"github.com/graphql-go/graphql/language/location"
	"github.com/graphql-go/graphql/testutil"
)

type testDog struct {
	Name  string `json:"name"`
	Woofs bool   `json:"woofs"`
}

type testCat struct {
	Name  string `json:"name"`
	Meows bool   `json:"meows"`
}

type testHuman struct {
	Name string `json:"name"`
}

func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {

	petType := graphql.NewInterface(graphql.InterfaceConfig{
		Name: "Pet",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	})

	// ie declare that Dog belongs to Pet interface
	dogType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Dog",
		Interfaces: []*graphql.Interface{
			petType,
		},
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testDog)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if dog, ok := p.Source.(*testDog); ok {
						return dog.Name, nil
					}
					return nil, nil
				},
			},
			"woofs": &graphql.Field{
				Type: graphql.Boolean,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if dog, ok := p.Source.(*testDog); ok {
						return dog.Woofs, nil
					}
					return nil, nil
				},
			},
		},
	})
	// ie declare that Cat belongs to Pet interface
	catType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Cat",
		Interfaces: []*graphql.Interface{
			petType,
		},
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testCat)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if cat, ok := p.Source.(*testCat); ok {
						return cat.Name, nil
					}
					return nil, nil
				},
			},
			"meows": &graphql.Field{
				Type: graphql.Boolean,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if cat, ok := p.Source.(*testCat); ok {
						return cat.Meows, nil
					}
					return nil, nil
				},
			},
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"pets": &graphql.Field{
					Type: graphql.NewList(petType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return []interface{}{
							&testDog{"Odie", true},
							&testCat{"Garfield", false},
						}, nil
					},
				},
			},
		}),
		Types: []graphql.Type{catType, dogType},
	})
	if err != nil {
		t.Fatalf("Error in schema %v", err.Error())
	}

	query := `{
      pets {
        name
        ... on Dog {
          woofs
        }
        ... on Cat {
          meows
        }
      }
    }`

	expected := &graphql.Result{
		Data: map[string]interface{}{
			"pets": []interface{}{
				map[string]interface{}{
					"name":  "Odie",
					"woofs": bool(true),
				},
				map[string]interface{}{
					"name":  "Garfield",
					"meows": bool(false),
				},
			},
		},
		Errors: nil,
	}

	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) != 0 {
		t.Fatalf("wrong result, unexpected errors: %v", result.Errors)
	}
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestAppendTypeUsedToAddRuntimeCustomScalarTypeForInterface(t *testing.T) {

	petType := graphql.NewInterface(graphql.InterfaceConfig{
		Name: "Pet",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	})

	// ie declare that Dog belongs to Pet interface
	dogType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Dog",
		Interfaces: []*graphql.Interface{
			petType,
		},
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testDog)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if dog, ok := p.Source.(*testDog); ok {
						return dog.Name, nil
					}
					return nil, nil
				},
			},
			"woofs": &graphql.Field{
				Type: graphql.Boolean,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if dog, ok := p.Source.(*testDog); ok {
						return dog.Woofs, nil
					}
					return nil, nil
				},
			},
		},
	})
	// ie declare that Cat belongs to Pet interface
	catType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Cat",
		Interfaces: []*graphql.Interface{
			petType,
		},
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testCat)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if cat, ok := p.Source.(*testCat); ok {
						return cat.Name, nil
					}
					return nil, nil
				},
			},
			"meows": &graphql.Field{
				Type: graphql.Boolean,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if cat, ok := p.Source.(*testCat); ok {
						return cat.Meows, nil
					}
					return nil, nil
				},
			},
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"pets": &graphql.Field{
					Type: graphql.NewList(petType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return []interface{}{
							&testDog{"Odie", true},
							&testCat{"Garfield", false},
						}, nil
					},
				},
			},
		}),
	})
	if err != nil {
		t.Fatalf("Error in schema %v", err.Error())
	}

	//Now add types catType and dogType at runtime.
	schema.AppendType(catType)
	schema.AppendType(dogType)

	query := `{
	      pets {
		name
		... on Dog {
		  woofs
		}
		... on Cat {
		  meows
		}
	      }
	    }`

	expected := &graphql.Result{
		Data: map[string]interface{}{
			"pets": []interface{}{
				map[string]interface{}{
					"name":  "Odie",
					"woofs": bool(true),
				},
				map[string]interface{}{
					"name":  "Garfield",
					"meows": bool(false),
				},
			},
		},
		Errors: nil,
	}

	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) != 0 {
		t.Fatalf("wrong result, unexpected errors: %v", result.Errors)
	}
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {

	dogType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Dog",
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testDog)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"woofs": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	catType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Cat",
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			_, ok := p.Value.(*testCat)
			return ok
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"meows": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	// ie declare Pet has Dot and Cat object types
	petType := graphql.NewUnion(graphql.UnionConfig{
		Name: "Pet",
		Types: []*graphql.Object{
			dogType, catType,
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"pets": &graphql.Field{
					Type: graphql.NewList(petType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return []interface{}{
							&testDog{"Odie", true},
							&testCat{"Garfield", false},
						}, nil
					},
				},
			},
		}),
	})
	if err != nil {
		t.Fatalf("Error in schema %v", err.Error())
	}

	query := `{
      pets {
        ... on Dog {
          name
          woofs
        }
        ... on Cat {
          name
          meows
        }
      }
    }`

	expected := &graphql.Result{
		Data: map[string]interface{}{
			"pets": []interface{}{
				map[string]interface{}{
					"name":  "Odie",
					"woofs": bool(true),
				},
				map[string]interface{}{
					"name":  "Garfield",
					"meows": bool(false),
				},
			},
		},
		Errors: nil,
	}

	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) != 0 {
		t.Fatalf("wrong result, unexpected errors: %v", result.Errors)
	}
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {

	var dogType *graphql.Object
	var catType *graphql.Object
	var humanType *graphql.Object
	petType := graphql.NewInterface(graphql.InterfaceConfig{
		Name: "Pet",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
		ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object {
			if _, ok := p.Value.(*testCat); ok {
				return catType
			}
			if _, ok := p.Value.(*testDog); ok {
				return dogType
			}
			if _, ok := p.Value.(*testHuman); ok {
				return humanType
			}
			return nil
		},
	})

	humanType = graphql.NewObject(graphql.ObjectConfig{
		Name: "Human",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	})
	dogType = graphql.NewObject(graphql.ObjectConfig{
		Name: "Dog",
		Interfaces: []*graphql.Interface{
			petType,
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"woofs": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	catType = graphql.NewObject(graphql.ObjectConfig{
		Name: "Cat",
		Interfaces: []*graphql.Interface{
			petType,
		},
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"meows": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"pets": &graphql.Field{
					Type: graphql.NewList(petType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return []interface{}{
							&testDog{"Odie", true},
							&testCat{"Garfield", false},
							&testHuman{"Jon"},
						}, nil
					},
				},
			},
		}),
		Types: []graphql.Type{catType, dogType},
	})
	if err != nil {
		t.Fatalf("Error in schema %v", err.Error())
	}

	query := `{
      pets {
        name
        ... on Dog {
          woofs
        }
        ... on Cat {
          meows
        }
      }
    }`

	expected := &graphql.Result{
		Data: map[string]interface{}{
			"pets": []interface{}{
				map[string]interface{}{
					"name":  "Odie",
					"woofs": bool(true),
				},
				map[string]interface{}{
					"name":  "Garfield",
					"meows": bool(false),
				},
				nil,
			},
		},
		Errors: []gqlerrors.FormattedError{
			{
				Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
				Locations: []location.SourceLocation{
					{
						Line:   2,
						Column: 7,
					},
				},
				Path: []interface{}{
					"pets",
					2,
				},
			},
		},
	}

	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {

	humanType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Human",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	})
	dogType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Dog",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"woofs": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	catType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Cat",
		Fields: graphql.Fields{
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"meows": &graphql.Field{
				Type: graphql.Boolean,
			},
		},
	})
	petType := graphql.NewUnion(graphql.UnionConfig{
		Name: "Pet",
		Types: []*graphql.Object{
			dogType, catType,
		},
		ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object {
			if _, ok := p.Value.(*testCat); ok {
				return catType
			}
			if _, ok := p.Value.(*testDog); ok {
				return dogType
			}
			if _, ok := p.Value.(*testHuman); ok {
				return humanType
			}
			return nil
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"pets": &graphql.Field{
					Type: graphql.NewList(petType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return []interface{}{
							&testDog{"Odie", true},
							&testCat{"Garfield", false},
							&testHuman{"Jon"},
						}, nil
					},
				},
			},
		}),
	})
	if err != nil {
		t.Fatalf("Error in schema %v", err.Error())
	}

	query := `{
      pets {
        ... on Dog {
          name
          woofs
        }
        ... on Cat {
          name
          meows
        }
      }
    }`

	expected := &graphql.Result{
		Data: map[string]interface{}{
			"pets": []interface{}{
				map[string]interface{}{
					"name":  "Odie",
					"woofs": bool(true),
				},
				map[string]interface{}{
					"name":  "Garfield",
					"meows": bool(false),
				},
				nil,
			},
		},
		Errors: []gqlerrors.FormattedError{
			{
				Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
				Locations: []location.SourceLocation{
					{
						Line:   2,
						Column: 7,
					},
				},
				Path: []interface{}{
					"pets",
					2,
				},
			},
		},
	}

	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}


================================================
FILE: benchutil/list_schema.go
================================================
package benchutil

import (
	"fmt"

	"github.com/graphql-go/graphql"
)

type color struct {
	Hex string
	R   int
	G   int
	B   int
}

func ListSchemaWithXItems(x int) graphql.Schema {

	list := generateXListItems(x)

	color := graphql.NewObject(graphql.ObjectConfig{
		Name:        "Color",
		Description: "A color",
		Fields: graphql.Fields{
			"hex": &graphql.Field{
				Type:        graphql.NewNonNull(graphql.String),
				Description: "Hex color code.",
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if c, ok := p.Source.(color); ok {
						return c.Hex, nil
					}
					return nil, nil
				},
			},
			"r": &graphql.Field{
				Type:        graphql.NewNonNull(graphql.Int),
				Description: "Red value.",
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if c, ok := p.Source.(color); ok {
						return c.R, nil
					}
					return nil, nil
				},
			},
			"g": &graphql.Field{
				Type:        graphql.NewNonNull(graphql.Int),
				Description: "Green value.",
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if c, ok := p.Source.(color); ok {
						return c.G, nil
					}
					return nil, nil
				},
			},
			"b": &graphql.Field{
				Type:        graphql.NewNonNull(graphql.Int),
				Description: "Blue value.",
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					if c, ok := p.Source.(color); ok {
						return c.B, nil
					}
					return nil, nil
				},
			},
		},
	})

	queryType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Query",
		Fields: graphql.Fields{
			"colors": {
				Type: graphql.NewList(color),
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					return list, nil
				},
			},
		},
	})

	colorSchema, _ := graphql.NewSchema(graphql.SchemaConfig{
		Query: queryType,
	})

	return colorSchema
}

var colors []color

func init() {
	colors = make([]color, 0, 256*16*16)

	for r := 0; r < 256; r++ {
		for g := 0; g < 16; g++ {
			for b := 0; b < 16; b++ {
				colors = append(colors, color{
					Hex: fmt.Sprintf("#%x%x%x", r, g, b),
					R:   r,
					G:   g,
					B:   b,
				})
			}
		}
	}
}

func generateXListItems(x int) []color {
	if x > len(colors) {
		x = len(colors)
	}
	return colors[0:x]
}


================================================
FILE: benchutil/wide_schema.go
================================================
package benchutil

import (
	"fmt"

	"github.com/graphql-go/graphql"
)

func WideSchemaWithXFieldsAndYItems(x int, y int) graphql.Schema {
	wide := graphql.NewObject(graphql.ObjectConfig{
		Name:        "Wide",
		Description: "An object",
		Fields:      generateXWideFields(x),
	})

	queryType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Query",
		Fields: graphql.Fields{
			"wide": {
				Type: graphql.NewList(wide),
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					out := make([]struct{}, 0, y)
					for i := 0; i < y; i++ {
						out = append(out, struct{}{})
					}
					return out, nil
				},
			},
		},
	})

	wideSchema, _ := graphql.NewSchema(graphql.SchemaConfig{
		Query: queryType,
	})

	return wideSchema
}

func generateXWideFields(x int) graphql.Fields {
	fields := graphql.Fields{}
	for i := 0; i < x; i++ {
		fields[generateFieldNameFromX(i)] = generateWideFieldFromX(i)
	}
	return fields
}

func generateWideFieldFromX(x int) *graphql.Field {
	return &graphql.Field{
		Type:    generateWideTypeFromX(x),
		Resolve: generateWideResolveFromX(x),
	}
}

func generateWideTypeFromX(x int) graphql.Type {
	switch x % 8 {
	case 0:
		return graphql.String
	case 1:
		return graphql.NewNonNull(graphql.String)
	case 2:
		return graphql.Int
	case 3:
		return graphql.NewNonNull(graphql.Int)
	case 4:
		return graphql.Float
	case 5:
		return graphql.NewNonNull(graphql.Float)
	case 6:
		return graphql.Boolean
	case 7:
		return graphql.NewNonNull(graphql.Boolean)
	}

	return nil
}

func generateFieldNameFromX(x int) string {
	var out string
	alphabet := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "z"}
	v := x
	for {
		r := v % 10
		out = alphabet[r] + out
		v /= 10
		if v == 0 {
			break
		}
	}
	return out
}

func generateWideResolveFromX(x int) func(p graphql.ResolveParams) (interface{}, error) {
	switch x % 8 {
	case 0:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return fmt.Sprint(x), nil
		}
	case 1:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return fmt.Sprint(x), nil
		}
	case 2:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return x, nil
		}
	case 3:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return x, nil
		}
	case 4:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return float64(x), nil
		}
	case 5:
		return func(p graphql.ResolveParams) (interface{}, error) {
			return float64(x), nil
		}
	case 6:
		return func(p graphql.ResolveParams) (interface{}, error) {
			if x%2 == 0 {
				return false, nil
			}
			return true, nil
		}
	case 7:
		return func(p graphql.ResolveParams) (interface{}, error) {
			if x%2 == 0 {
				return false, nil
			}
			return true, nil
		}
	}

	return nil
}

func WideSchemaQuery(x int) string {
	var fields string
	for i := 0; i < x; i++ {
		fields = fields + generateFieldNameFromX(i) + " "
	}

	return fmt.Sprintf("query { wide { %s} }", fields)
}


================================================
FILE: definition.go
================================================
package graphql

import (
	"context"
	"fmt"
	"reflect"
	"regexp"

	"github.com/graphql-go/graphql/language/ast"
)

// Type interface for all of the possible kinds of GraphQL types
type Type interface {
	Name() string
	Description() string
	String() string
	Error() error
}

var _ Type = (*Scalar)(nil)
var _ Type = (*Object)(nil)
var _ Type = (*Interface)(nil)
var _ Type = (*Union)(nil)
var _ Type = (*Enum)(nil)
var _ Type = (*InputObject)(nil)
var _ Type = (*List)(nil)
var _ Type = (*NonNull)(nil)
var _ Type = (*Argument)(nil)

// Input interface for types that may be used as input types for arguments and directives.
type Input interface {
	Name() string
	Description() string
	String() string
	Error() error
}

var _ Input = (*Scalar)(nil)
var _ Input = (*Enum)(nil)
var _ Input = (*InputObject)(nil)
var _ Input = (*List)(nil)
var _ Input = (*NonNull)(nil)

// IsInputType determines if given type is a GraphQLInputType
func IsInputType(ttype Type) bool {
	switch GetNamed(ttype).(type) {
	case *Scalar, *Enum, *InputObject:
		return true
	default:
		return false
	}
}

// IsOutputType determines if given type is a GraphQLOutputType
func IsOutputType(ttype Type) bool {
	switch GetNamed(ttype).(type) {
	case *Scalar, *Object, *Interface, *Union, *Enum:
		return true
	default:
		return false
	}
}

// Leaf interface for types that may be leaf values
type Leaf interface {
	Name() string
	Description() string
	String() string
	Error() error
	Serialize(value interface{}) interface{}
}

var _ Leaf = (*Scalar)(nil)
var _ Leaf = (*Enum)(nil)

// IsLeafType determines if given type is a leaf value
func IsLeafType(ttype Type) bool {
	switch GetNamed(ttype).(type) {
	case *Scalar, *Enum:
		return true
	default:
		return false
	}
}

// Output interface for types that may be used as output types as the result of fields.
type Output interface {
	Name() string
	Description() string
	String() string
	Error() error
}

var _ Output = (*Scalar)(nil)
var _ Output = (*Object)(nil)
var _ Output = (*Interface)(nil)
var _ Output = (*Union)(nil)
var _ Output = (*Enum)(nil)
var _ Output = (*List)(nil)
var _ Output = (*NonNull)(nil)

// Composite interface for types that may describe the parent context of a selection set.
type Composite interface {
	Name() string
	Description() string
	String() string
	Error() error
}

var _ Composite = (*Object)(nil)
var _ Composite = (*Interface)(nil)
var _ Composite = (*Union)(nil)

// IsCompositeType determines if given type is a GraphQLComposite type
func IsCompositeType(ttype interface{}) bool {
	switch ttype.(type) {
	case *Object, *Interface, *Union:
		return true
	default:
		return false
	}
}

// Abstract interface for types that may describe the parent context of a selection set.
type Abstract interface {
	Name() string
}

var _ Abstract = (*Interface)(nil)
var _ Abstract = (*Union)(nil)

func IsAbstractType(ttype interface{}) bool {
	switch ttype.(type) {
	case *Interface, *Union:
		return true
	default:
		return false
	}
}

// Nullable interface for types that can accept null as a value.
type Nullable interface {
}

var _ Nullable = (*Scalar)(nil)
var _ Nullable = (*Object)(nil)
var _ Nullable = (*Interface)(nil)
var _ Nullable = (*Union)(nil)
var _ Nullable = (*Enum)(nil)
var _ Nullable = (*InputObject)(nil)
var _ Nullable = (*List)(nil)

// GetNullable returns the Nullable type of the given GraphQL type
func GetNullable(ttype Type) Nullable {
	if ttype, ok := ttype.(*NonNull); ok {
		return ttype.OfType
	}
	return ttype
}

// Named interface for types that do not include modifiers like List or NonNull.
type Named interface {
	String() string
}

var _ Named = (*Scalar)(nil)
var _ Named = (*Object)(nil)
var _ Named = (*Interface)(nil)
var _ Named = (*Union)(nil)
var _ Named = (*Enum)(nil)
var _ Named = (*InputObject)(nil)

// GetNamed returns the Named type of the given GraphQL type
func GetNamed(ttype Type) Named {
	unmodifiedType := ttype
	for {
		switch typ := unmodifiedType.(type) {
		case *List:
			unmodifiedType = typ.OfType
		case *NonNull:
			unmodifiedType = typ.OfType
		default:
			return unmodifiedType
		}
	}
}

// Scalar Type Definition
//
// The leaf values of any request and input values to arguments are
// Scalars (or Enums) and are defined with a name and a series of functions
// used to parse input from ast or variables and to ensure validity.
//
// Example:
//
//	var OddType = new Scalar({
//	  name: 'Odd',
//	  serialize(value) {
//	    return value % 2 === 1 ? value : null;
//	  }
//	});
type Scalar struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`

	scalarConfig ScalarConfig
	err          error
}

// SerializeFn is a function type for serializing a GraphQLScalar type value
type SerializeFn func(value interface{}) interface{}

// ParseValueFn is a function type for parsing the value of a GraphQLScalar type
type ParseValueFn func(value interface{}) interface{}

// ParseLiteralFn is a function type for parsing the literal value of a GraphQLScalar type
type ParseLiteralFn func(valueAST ast.Value) interface{}

// ScalarConfig options for creating a new GraphQLScalar
type ScalarConfig struct {
	Name         string `json:"name"`
	Description  string `json:"description"`
	Serialize    SerializeFn
	ParseValue   ParseValueFn
	ParseLiteral ParseLiteralFn
}

// NewScalar creates a new GraphQLScalar
func NewScalar(config ScalarConfig) *Scalar {
	st := &Scalar{}
	err := invariant(config.Name != "", "Type must be named.")
	if err != nil {
		st.err = err
		return st
	}

	err = assertValidName(config.Name)
	if err != nil {
		st.err = err
		return st
	}

	st.PrivateName = config.Name
	st.PrivateDescription = config.Description

	err = invariantf(
		config.Serialize != nil,
		`%v must provide "serialize" function. If this custom Scalar is `+
			`also used as an input type, ensure "parseValue" and "parseLiteral" `+
			`functions are also provided.`, st,
	)
	if err != nil {
		st.err = err
		return st
	}
	if config.ParseValue != nil || config.ParseLiteral != nil {
		err = invariantf(
			config.ParseValue != nil && config.ParseLiteral != nil,
			`%v must provide both "parseValue" and "parseLiteral" functions.`, st,
		)
		if err != nil {
			st.err = err
			return st
		}
	}

	st.scalarConfig = config
	return st
}
func (st *Scalar) Serialize(value interface{}) interface{} {
	if st.scalarConfig.Serialize == nil {
		return value
	}
	return st.scalarConfig.Serialize(value)
}
func (st *Scalar) ParseValue(value interface{}) interface{} {
	if st.scalarConfig.ParseValue == nil {
		return value
	}
	return st.scalarConfig.ParseValue(value)
}
func (st *Scalar) ParseLiteral(valueAST ast.Value) interface{} {
	if st.scalarConfig.ParseLiteral == nil {
		return nil
	}
	return st.scalarConfig.ParseLiteral(valueAST)
}
func (st *Scalar) Name() string {
	return st.PrivateName
}
func (st *Scalar) Description() string {
	return st.PrivateDescription

}
func (st *Scalar) String() string {
	return st.PrivateName
}
func (st *Scalar) Error() error {
	return st.err
}

// Object Type Definition
//
// Almost all of the GraphQL types you define will be object  Object types
// have a name, but most importantly describe their fields.
// Example:
//
//	var AddressType = new Object({
//	  name: 'Address',
//	  fields: {
//	    street: { type: String },
//	    number: { type: Int },
//	    formatted: {
//	      type: String,
//	      resolve(obj) {
//	        return obj.number + ' ' + obj.street
//	      }
//	    }
//	  }
//	});
//
// When two types need to refer to each other, or a type needs to refer to
// itself in a field, you can use a function expression (aka a closure or a
// thunk) to supply the fields lazily.
//
// Example:
//
//	var PersonType = new Object({
//	  name: 'Person',
//	  fields: () => ({
//	    name: { type: String },
//	    bestFriend: { type: PersonType },
//	  })
//	});
//
// /
type Object struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`
	IsTypeOf           IsTypeOfFn

	typeConfig            ObjectConfig
	initialisedFields     bool
	fields                FieldDefinitionMap
	initialisedInterfaces bool
	interfaces            []*Interface
	// Interim alternative to throwing an error during schema definition at run-time
	err error
}

// IsTypeOfParams Params for IsTypeOfFn()
type IsTypeOfParams struct {
	// Value that needs to be resolve.
	// Use this to decide which GraphQLObject this value maps to.
	Value interface{}

	// Info is a collection of information about the current execution state.
	Info ResolveInfo

	// Context argument is a context value that is provided to every resolve function within an execution.
	// It is commonly
	// used to represent an authenticated user, or request-specific caches.
	Context context.Context
}

type IsTypeOfFn func(p IsTypeOfParams) bool

type InterfacesThunk func() []*Interface

type ObjectConfig struct {
	Name        string      `json:"name"`
	Interfaces  interface{} `json:"interfaces"`
	Fields      interface{} `json:"fields"`
	IsTypeOf    IsTypeOfFn  `json:"isTypeOf"`
	Description string      `json:"description"`
}

type FieldsThunk func() Fields

func NewObject(config ObjectConfig) *Object {
	objectType := &Object{}

	err := invariant(config.Name != "", "Type must be named.")
	if err != nil {
		objectType.err = err
		return objectType
	}
	err = assertValidName(config.Name)
	if err != nil {
		objectType.err = err
		return objectType
	}

	objectType.PrivateName = config.Name
	objectType.PrivateDescription = config.Description
	objectType.IsTypeOf = config.IsTypeOf
	objectType.typeConfig = config

	return objectType
}

// ensureCache ensures that both fields and interfaces have been initialized properly,
// to prevent races.
func (gt *Object) ensureCache() {
	gt.Fields()
	gt.Interfaces()
}
func (gt *Object) AddFieldConfig(fieldName string, fieldConfig *Field) {
	if fieldName == "" || fieldConfig == nil {
		return
	}
	if fields, ok := gt.typeConfig.Fields.(Fields); ok {
		fields[fieldName] = fieldConfig
		gt.initialisedFields = false
	}
}
func (gt *Object) Name() string {
	return gt.PrivateName
}
func (gt *Object) Description() string {
	return gt.PrivateDescription
}
func (gt *Object) String() string {
	return gt.PrivateName
}
func (gt *Object) Fields() FieldDefinitionMap {
	if gt.initialisedFields {
		return gt.fields
	}

	var configureFields Fields
	switch fields := gt.typeConfig.Fields.(type) {
	case Fields:
		configureFields = fields
	case FieldsThunk:
		configureFields = fields()
	}

	gt.fields, gt.err = defineFieldMap(gt, configureFields)
	gt.initialisedFields = true
	return gt.fields
}

func (gt *Object) Interfaces() []*Interface {
	if gt.initialisedInterfaces {
		return gt.interfaces
	}

	var configInterfaces []*Interface
	switch iface := gt.typeConfig.Interfaces.(type) {
	case InterfacesThunk:
		configInterfaces = iface()
	case []*Interface:
		configInterfaces = iface
	case nil:
	default:
		gt.err = fmt.Errorf("Unknown Object.Interfaces type: %T", gt.typeConfig.Interfaces)
		gt.initialisedInterfaces = true
		return nil
	}

	gt.interfaces, gt.err = defineInterfaces(gt, configInterfaces)
	gt.initialisedInterfaces = true
	return gt.interfaces
}

func (gt *Object) Error() error {
	return gt.err
}

func defineInterfaces(ttype *Object, interfaces []*Interface) ([]*Interface, error) {
	ifaces := []*Interface{}

	if len(interfaces) == 0 {
		return ifaces, nil
	}
	for _, iface := range interfaces {
		err := invariantf(
			iface != nil,
			`%v may only implement Interface types, it cannot implement: %v.`, ttype, iface,
		)
		if err != nil {
			return ifaces, err
		}
		if iface.ResolveType != nil {
			err = invariantf(
				iface.ResolveType != nil,
				`Interface Type %v does not provide a "resolveType" function `+
					`and implementing Type %v does not provide a "isTypeOf" `+
					`function. There is no way to resolve this implementing type `+
					`during execution.`, iface, ttype,
			)
			if err != nil {
				return ifaces, err
			}
		}
		ifaces = append(ifaces, iface)
	}

	return ifaces, nil
}

func defineFieldMap(ttype Named, fieldMap Fields) (FieldDefinitionMap, error) {
	resultFieldMap := FieldDefinitionMap{}

	err := invariantf(
		len(fieldMap) > 0,
		`%v fields must be an object with field names as keys or a function which return such an object.`, ttype,
	)
	if err != nil {
		return resultFieldMap, err
	}

	for fieldName, field := range fieldMap {
		if field == nil {
			continue
		}
		err = invariantf(
			field.Type != nil,
			`%v.%v field type must be Output Type but got: %v.`, ttype, fieldName, field.Type,
		)
		if err != nil {
			return resultFieldMap, err
		}
		if field.Type.Error() != nil {
			return resultFieldMap, field.Type.Error()
		}
		if err = assertValidName(fieldName); err != nil {
			return resultFieldMap, err
		}
		fieldDef := &FieldDefinition{
			Name:              fieldName,
			Description:       field.Description,
			Type:              field.Type,
			Resolve:           field.Resolve,
			Subscribe:         field.Subscribe,
			DeprecationReason: field.DeprecationReason,
		}

		fieldDef.Args = []*Argument{}
		for argName, arg := range field.Args {
			if err = assertValidName(argName); err != nil {
				return resultFieldMap, err
			}
			if err = invariantf(
				arg != nil,
				`%v.%v args must be an object with argument names as keys.`, ttype, fieldName,
			); err != nil {
				return resultFieldMap, err
			}
			if err = invariantf(
				arg.Type != nil,
				`%v.%v(%v:) argument type must be Input Type but got: %v.`, ttype, fieldName, argName, arg.Type,
			); err != nil {
				return resultFieldMap, err
			}
			fieldArg := &Argument{
				PrivateName:        argName,
				PrivateDescription: arg.Description,
				Type:               arg.Type,
				DefaultValue:       arg.DefaultValue,
			}
			fieldDef.Args = append(fieldDef.Args, fieldArg)
		}
		resultFieldMap[fieldName] = fieldDef
	}
	return resultFieldMap, nil
}

// ResolveParams Params for FieldResolveFn()
type ResolveParams struct {
	// Source is the source value
	Source interface{}

	// Args is a map of arguments for current GraphQL request
	Args map[string]interface{}

	// Info is a collection of information about the current execution state.
	Info ResolveInfo

	// Context argument is a context value that is provided to every resolve function within an execution.
	// It is commonly
	// used to represent an authenticated user, or request-specific caches.
	Context context.Context
}

type FieldResolveFn func(p ResolveParams) (interface{}, error)

type ResolveInfo struct {
	FieldName      string
	FieldASTs      []*ast.Field
	Path           *ResponsePath
	ReturnType     Output
	ParentType     Composite
	Schema         Schema
	Fragments      map[string]ast.Definition
	RootValue      interface{}
	Operation      ast.Definition
	VariableValues map[string]interface{}
}

type Fields map[string]*Field

type Field struct {
	Name              string              `json:"name"` // used by graphlql-relay
	Type              Output              `json:"type"`
	Args              FieldConfigArgument `json:"args"`
	Resolve           FieldResolveFn      `json:"-"`
	Subscribe         FieldResolveFn      `json:"-"`
	DeprecationReason string              `json:"deprecationReason"`
	Description       string              `json:"description"`
}

type FieldConfigArgument map[string]*ArgumentConfig

type ArgumentConfig struct {
	Type         Input       `json:"type"`
	DefaultValue interface{} `json:"defaultValue"`
	Description  string      `json:"description"`
}

type FieldDefinitionMap map[string]*FieldDefinition
type FieldDefinition struct {
	Name              string         `json:"name"`
	Description       string         `json:"description"`
	Type              Output         `json:"type"`
	Args              []*Argument    `json:"args"`
	Resolve           FieldResolveFn `json:"-"`
	Subscribe         FieldResolveFn `json:"-"`
	DeprecationReason string         `json:"deprecationReason"`
}

type FieldArgument struct {
	Name         string      `json:"name"`
	Type         Type        `json:"type"`
	DefaultValue interface{} `json:"defaultValue"`
	Description  string      `json:"description"`
}

type Argument struct {
	PrivateName        string      `json:"name"`
	Type               Input       `json:"type"`
	DefaultValue       interface{} `json:"defaultValue"`
	PrivateDescription string      `json:"description"`
}

func (st *Argument) Name() string {
	return st.PrivateName
}
func (st *Argument) Description() string {
	return st.PrivateDescription

}
func (st *Argument) String() string {
	return st.PrivateName
}
func (st *Argument) Error() error {
	return nil
}

// Interface Type Definition
//
// When a field can return one of a heterogeneous set of types, a Interface type
// is used to describe what types are possible, what fields are in common across
// all types, as well as a function to determine which type is actually used
// when the field is resolved.
//
// Example:
//
//	var EntityType = new Interface({
//	  name: 'Entity',
//	  fields: {
//	    name: { type: String }
//	  }
//	});
type Interface struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`
	ResolveType        ResolveTypeFn

	typeConfig        InterfaceConfig
	initialisedFields bool
	fields            FieldDefinitionMap
	err               error
}
type InterfaceConfig struct {
	Name        string      `json:"name"`
	Fields      interface{} `json:"fields"`
	ResolveType ResolveTypeFn
	Description string `json:"description"`
}

// ResolveTypeParams Params for ResolveTypeFn()
type ResolveTypeParams struct {
	// Value that needs to be resolve.
	// Use this to decide which GraphQLObject this value maps to.
	Value interface{}

	// Info is a collection of information about the current execution state.
	Info ResolveInfo

	// Context argument is a context value that is provided to every resolve function within an execution.
	// It is commonly
	// used to represent an authenticated user, or request-specific caches.
	Context context.Context
}

type ResolveTypeFn func(p ResolveTypeParams) *Object

func NewInterface(config InterfaceConfig) *Interface {
	it := &Interface{}

	if it.err = invariant(config.Name != "", "Type must be named."); it.err != nil {
		return it
	}
	if it.err = assertValidName(config.Name); it.err != nil {
		return it
	}
	it.PrivateName = config.Name
	it.PrivateDescription = config.Description
	it.ResolveType = config.ResolveType
	it.typeConfig = config

	return it
}

func (it *Interface) AddFieldConfig(fieldName string, fieldConfig *Field) {
	if fieldName == "" || fieldConfig == nil {
		return
	}
	if fields, ok := it.typeConfig.Fields.(Fields); ok {
		fields[fieldName] = fieldConfig
		it.initialisedFields = false
	}
}

func (it *Interface) Name() string {
	return it.PrivateName
}

func (it *Interface) Description() string {
	return it.PrivateDescription
}

func (it *Interface) Fields() (fields FieldDefinitionMap) {
	if it.initialisedFields {
		return it.fields
	}

	var configureFields Fields
	switch fields := it.typeConfig.Fields.(type) {
	case Fields:
		configureFields = fields
	case FieldsThunk:
		configureFields = fields()
	}

	it.fields, it.err = defineFieldMap(it, configureFields)
	it.initialisedFields = true
	return it.fields
}

func (it *Interface) String() string {
	return it.PrivateName
}

func (it *Interface) Error() error {
	return it.err
}

// Union Type Definition
//
// When a field can return one of a heterogeneous set of types, a Union type
// is used to describe what types are possible as well as providing a function
// to determine which type is actually used when the field is resolved.
//
// Example:
//
//	var PetType = new Union({
//	  name: 'Pet',
//	  types: [ DogType, CatType ],
//	  resolveType(value) {
//	    if (value instanceof Dog) {
//	      return DogType;
//	    }
//	    if (value instanceof Cat) {
//	      return CatType;
//	    }
//	  }
//	});
type Union struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`
	ResolveType        ResolveTypeFn

	typeConfig      UnionConfig
	initalizedTypes bool
	types           []*Object
	possibleTypes   map[string]bool

	err error
}

type UnionTypesThunk func() []*Object

type UnionConfig struct {
	Name        string      `json:"name"`
	Types       interface{} `json:"types"`
	ResolveType ResolveTypeFn
	Description string `json:"description"`
}

func NewUnion(config UnionConfig) *Union {
	objectType := &Union{}

	if objectType.err = invariant(config.Name != "", "Type must be named."); objectType.err != nil {
		return objectType
	}
	if objectType.err = assertValidName(config.Name); objectType.err != nil {
		return objectType
	}
	objectType.PrivateName = config.Name
	objectType.PrivateDescription = config.Description
	objectType.ResolveType = config.ResolveType

	objectType.typeConfig = config

	return objectType
}

func (ut *Union) Types() []*Object {
	if ut.initalizedTypes {
		return ut.types
	}

	var unionTypes []*Object
	switch utype := ut.typeConfig.Types.(type) {
	case UnionTypesThunk:
		unionTypes = utype()
	case []*Object:
		unionTypes = utype
	case nil:
	default:
		ut.err = fmt.Errorf("Unknown Union.Types type: %T", ut.typeConfig.Types)
		ut.initalizedTypes = true
		return nil
	}

	ut.types, ut.err = defineUnionTypes(ut, unionTypes)
	ut.initalizedTypes = true
	return ut.types
}

func defineUnionTypes(objectType *Union, unionTypes []*Object) ([]*Object, error) {
	definedUnionTypes := []*Object{}

	if err := invariantf(
		len(unionTypes) > 0,
		`Must provide Array of types for Union %v.`, objectType.Name(),
	); err != nil {
		return definedUnionTypes, err
	}

	for _, ttype := range unionTypes {
		if err := invariantf(
			ttype != nil,
			`%v may only contain Object types, it cannot contain: %v.`, objectType, ttype,
		); err != nil {
			return definedUnionTypes, err
		}
		if objectType.ResolveType == nil {
			if err := invariantf(
				ttype.IsTypeOf != nil,
				`Union Type %v does not provide a "resolveType" function `+
					`and possible Type %v does not provide a "isTypeOf" `+
					`function. There is no way to resolve this possible type `+
					`during execution.`, objectType, ttype,
			); err != nil {
				return definedUnionTypes, err
			}
		}
		definedUnionTypes = append(definedUnionTypes, ttype)
	}

	return definedUnionTypes, nil
}

func (ut *Union) String() string {
	return ut.PrivateName
}

func (ut *Union) Name() string {
	return ut.PrivateName
}

func (ut *Union) Description() string {
	return ut.PrivateDescription
}

func (ut *Union) Error() error {
	return ut.err
}

// Enum Type Definition
//
// Some leaf values of requests and input values are Enums. GraphQL serializes
// Enum values as strings, however internally Enums can be represented by any
// kind of type, often integers.
//
// Example:
//
//     var RGBType = new Enum({
//       name: 'RGB',
//       values: {
//         RED: { value: 0 },
//         GREEN: { value: 1 },
//         BLUE: { value: 2 }
//       }
//     });
//
// Note: If a value is not provided in a definition, the name of the enum value
// will be used as its internal value.

type Enum struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`

	enumConfig   EnumConfig
	values       []*EnumValueDefinition
	valuesLookup map[interface{}]*EnumValueDefinition
	nameLookup   map[string]*EnumValueDefinition

	err error
}
type EnumValueConfigMap map[string]*EnumValueConfig
type EnumValueConfig struct {
	Value             interface{} `json:"value"`
	DeprecationReason string      `json:"deprecationReason"`
	Description       string      `json:"description"`
}
type EnumConfig struct {
	Name        string             `json:"name"`
	Values      EnumValueConfigMap `json:"values"`
	Description string             `json:"description"`
}
type EnumValueDefinition struct {
	Name              string      `json:"name"`
	Value             interface{} `json:"value"`
	DeprecationReason string      `json:"deprecationReason"`
	Description       string      `json:"description"`
}

func NewEnum(config EnumConfig) *Enum {
	gt := &Enum{}
	gt.enumConfig = config

	if gt.err = assertValidName(config.Name); gt.err != nil {
		return gt
	}

	gt.PrivateName = config.Name
	gt.PrivateDescription = config.Description
	if gt.values, gt.err = gt.defineEnumValues(config.Values); gt.err != nil {
		return gt
	}

	return gt
}
func (gt *Enum) defineEnumValues(valueMap EnumValueConfigMap) ([]*EnumValueDefinition, error) {
	var err error
	values := []*EnumValueDefinition{}

	if err = invariantf(
		len(valueMap) > 0,
		`%v values must be an object with value names as keys.`, gt,
	); err != nil {
		return values, err
	}

	for valueName, valueConfig := range valueMap {
		if err = invariantf(
			valueConfig != nil,
			`%v.%v must refer to an object with a "value" key `+
				`representing an internal value but got: %v.`, gt, valueName, valueConfig,
		); err != nil {
			return values, err
		}
		if err = assertValidName(valueName); err != nil {
			return values, err
		}
		value := &EnumValueDefinition{
			Name:              valueName,
			Value:             valueConfig.Value,
			DeprecationReason: valueConfig.DeprecationReason,
			Description:       valueConfig.Description,
		}
		if value.Value == nil {
			value.Value = valueName
		}
		values = append(values, value)
	}
	return values, nil
}
func (gt *Enum) Values() []*EnumValueDefinition {
	return gt.values
}
func (gt *Enum) Serialize(value interface{}) interface{} {
	v := value
	rv := reflect.ValueOf(v)
	if kind := rv.Kind(); kind == reflect.Ptr && rv.IsNil() {
		return nil
	} else if kind == reflect.Ptr {
		v = reflect.Indirect(reflect.ValueOf(v)).Interface()
	}
	if enumValue, ok := gt.getValueLookup()[v]; ok {
		return enumValue.Name
	}
	return nil
}
func (gt *Enum) ParseValue(value interface{}) interface{} {
	var v string

	switch value := value.(type) {
	case string:
		v = value
	case *string:
		v = *value
	default:
		return nil
	}
	if enumValue, ok := gt.getNameLookup()[v]; ok {
		return enumValue.Value
	}
	return nil
}
func (gt *Enum) ParseLiteral(valueAST ast.Value) interface{} {
	if valueAST, ok := valueAST.(*ast.EnumValue); ok {
		if enumValue, ok := gt.getNameLookup()[valueAST.Value]; ok {
			return enumValue.Value
		}
	}
	return nil
}
func (gt *Enum) Name() string {
	return gt.PrivateName
}
func (gt *Enum) Description() string {
	return gt.PrivateDescription
}
func (gt *Enum) String() string {
	return gt.PrivateName
}
func (gt *Enum) Error() error {
	return gt.err
}
func (gt *Enum) getValueLookup() map[interface{}]*EnumValueDefinition {
	if len(gt.valuesLookup) > 0 {
		return gt.valuesLookup
	}
	valuesLookup := map[interface{}]*EnumValueDefinition{}
	for _, value := range gt.Values() {
		valuesLookup[value.Value] = value
	}
	gt.valuesLookup = valuesLookup
	return gt.valuesLookup
}

func (gt *Enum) getNameLookup() map[string]*EnumValueDefinition {
	if len(gt.nameLookup) > 0 {
		return gt.nameLookup
	}
	nameLookup := map[string]*EnumValueDefinition{}
	for _, value := range gt.Values() {
		nameLookup[value.Name] = value
	}
	gt.nameLookup = nameLookup
	return gt.nameLookup
}

// InputObject Type Definition
//
// An input object defines a structured collection of fields which may be
// supplied to a field argument.
//
// # Using `NonNull` will ensure that a value must be provided by the query
//
// Example:
//
//	var GeoPoint = new InputObject({
//	  name: 'GeoPoint',
//	  fields: {
//	    lat: { type: new NonNull(Float) },
//	    lon: { type: new NonNull(Float) },
//	    alt: { type: Float, defaultValue: 0 },
//	  }
//	});
type InputObject struct {
	PrivateName        string `json:"name"`
	PrivateDescription string `json:"description"`

	typeConfig InputObjectConfig
	fields     InputObjectFieldMap
	init       bool
	err        error
}
type InputObjectFieldConfig struct {
	Type         Input       `json:"type"`
	DefaultValue interface{} `json:"defaultValue"`
	Description  string      `json:"description"`
}
type InputObjectField struct {
	PrivateName        string      `json:"name"`
	Type               Input       `json:"type"`
	DefaultValue       interface{} `json:"defaultValue"`
	PrivateDescription string      `json:"description"`
}

func (st *InputObjectField) Name() string {
	return st.PrivateName
}
func (st *InputObjectField) Description() string {
	return st.PrivateDescription
}
func (st *InputObjectField) String() string {
	return st.PrivateName
}
func (st *InputObjectField) Error() error {
	return nil
}

type InputObjectConfigFieldMap map[string]*InputObjectFieldConfig
type InputObjectFieldMap map[string]*InputObjectField
type InputObjectConfigFieldMapThunk func() InputObjectConfigFieldMap
type InputObjectConfig struct {
	Name        string      `json:"name"`
	Fields      interface{} `json:"fields"`
	Description string      `json:"description"`
}

func NewInputObject(config InputObjectConfig) *InputObject {
	gt := &InputObject{}
	if gt.err = invariant(config.Name != "", "Type must be named."); gt.err != nil {
		return gt
	}

	gt.PrivateName = config.Name
	gt.PrivateDescription = config.Description
	gt.typeConfig = config
	return gt
}

func (gt *InputObject) defineFieldMap() InputObjectFieldMap {
	var (
		fieldMap InputObjectConfigFieldMap
		err      error
	)
	switch fields := gt.typeConfig.Fields.(type) {
	case InputObjectConfigFieldMap:
		fieldMap = fields
	case InputObjectConfigFieldMapThunk:
		fieldMap = fields()
	}
	resultFieldMap := InputObjectFieldMap{}

	if gt.err = invariantf(
		len(fieldMap) > 0,
		`%v fields must be an object with field names as keys or a function which return such an object.`, gt,
	); gt.err != nil {
		return resultFieldMap
	}

	for fieldName, fieldConfig := range fieldMap {
		if fieldConfig == nil {
			continue
		}
		if err = assertValidName(fieldName); err != nil {
			continue
		}
		if gt.err = invariantf(
			fieldConfig.Type != nil,
			`%v.%v field type must be Input Type but got: %v.`, gt, fieldName, fieldConfig.Type,
		); gt.err != nil {
			return resultFieldMap
		}
		field := &InputObjectField{}
		field.PrivateName = fieldName
		field.Type = fieldConfig.Type
		field.PrivateDescription = fieldConfig.Description
		field.DefaultValue = fieldConfig.DefaultValue
		resultFieldMap[fieldName] = field
	}
	gt.init = true
	return resultFieldMap
}

func (gt *InputObject) AddFieldConfig(fieldName string, fieldConfig *InputObjectFieldConfig) {
	if fieldName == "" || fieldConfig == nil {
		return
	}
	fieldMap, ok := gt.typeConfig.Fields.(InputObjectConfigFieldMap)
	if gt.err = invariant(ok, "Cannot add field to a thunk"); gt.err != nil {
		return
	}
	fieldMap[fieldName] = fieldConfig
	gt.fields = gt.defineFieldMap()
}

func (gt *InputObject) Fields() InputObjectFieldMap {
	if !gt.init {
		gt.fields = gt.defineFieldMap()
	}
	return gt.fields
}
func (gt *InputObject) Name() string {
	return gt.PrivateName
}
func (gt *InputObject) Description() string {
	return gt.PrivateDescription
}
func (gt *InputObject) String() string {
	return gt.PrivateName
}
func (gt *InputObject) Error() error {
	return gt.err
}

// List Modifier
//
// A list is a kind of type marker, a wrapping type which points to another
// type. Lists are often created within the context of defining the fields of
// an object type.
//
// Example:
//
//	var PersonType = new Object({
//	  name: 'Person',
//	  fields: () => ({
//	    parents: { type: new List(Person) },
//	    children: { type: new List(Person) },
//	  })
//	})
type List struct {
	OfType Type `json:"ofType"`

	err error
}

func NewList(ofType Type) *List {
	gl := &List{}

	gl.err = invariantf(ofType != nil, `Can only create List of a Type but got: %v.`, ofType)
	if gl.err != nil {
		return gl
	}

	gl.OfType = ofType
	return gl
}
func (gl *List) Name() string {
	return fmt.Sprintf("[%v]", gl.OfType)
}
func (gl *List) Description() string {
	return ""
}
func (gl *List) String() string {
	if gl.OfType != nil {
		return gl.Name()
	}
	return ""
}
func (gl *List) Error() error {
	return gl.err
}

// NonNull Modifier
//
// A non-null is a kind of type marker, a wrapping type which points to another
// type. Non-null types enforce that their values are never null and can ensure
// an error is raised if this ever occurs during a request. It is useful for
// fields which you can make a strong guarantee on non-nullability, for example
// usually the id field of a database row will never be null.
//
// Example:
//
//	var RowType = new Object({
//	  name: 'Row',
//	  fields: () => ({
//	    id: { type: new NonNull(String) },
//	  })
//	})
//
// Note: the enforcement of non-nullability occurs within the executor.
type NonNull struct {
	OfType Type `json:"ofType"`

	err error
}

func NewNonNull(ofType Type) *NonNull {
	gl := &NonNull{}

	_, isOfTypeNonNull := ofType.(*NonNull)
	gl.err = invariantf(ofType != nil && !isOfTypeNonNull, `Can only create NonNull of a Nullable Type but got: %v.`, ofType)
	if gl.err != nil {
		return gl
	}
	gl.OfType = ofType
	return gl
}
func (gl *NonNull) Name() string {
	return fmt.Sprintf("%v!", gl.OfType)
}
func (gl *NonNull) Description() string {
	return ""
}
func (gl *NonNull) String() string {
	if gl.OfType != nil {
		return gl.Name()
	}
	return ""
}
func (gl *NonNull) Error() error {
	return gl.err
}

var NameRegExp = regexp.MustCompile("^[_a-zA-Z][_a-zA-Z0-9]*$")

func assertValidName(name string) error {
	return invariantf(
		NameRegExp.MatchString(name),
		`Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "%v" does not.`, name)

}

type ResponsePath struct {
	Prev *ResponsePath
	Key  interface{}
}

// WithKey returns a new responsePath containing the new key.
func (p *ResponsePath) WithKey(key interface{}) *ResponsePath {
	return &ResponsePath{
		Prev: p,
		Key:  key,
	}
}

// AsArray returns an array of path keys.
func (p *ResponsePath) AsArray() []interface{} {
	if p == nil {
		return nil
	}
	return append(p.Prev.AsArray(), p.Key)
}


================================================
FILE: definition_test.go
================================================
package graphql_test

import (
	"fmt"
	"reflect"
	"testing"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/testutil"
)

var blogImage = graphql.NewObject(graphql.ObjectConfig{
	Name: "Image",
	Fields: graphql.Fields{
		"url": &graphql.Field{
			Type: graphql.String,
		},
		"width": &graphql.Field{
			Type: graphql.Int,
		},
		"height": &graphql.Field{
			Type: graphql.Int,
		},
	},
})
var blogAuthor = graphql.NewObject(graphql.ObjectConfig{
	Name: "Author",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.String,
		},
		"name": &graphql.Field{
			Type: graphql.String,
		},
		"pic": &graphql.Field{
			Type: blogImage,
			Args: graphql.FieldConfigArgument{
				"width": &graphql.ArgumentConfig{
					Type: graphql.Int,
				},
				"height": &graphql.ArgumentConfig{
					Type: graphql.Int,
				},
			},
		},
		"recentArticle": &graphql.Field{},
	},
})
var blogArticle = graphql.NewObject(graphql.ObjectConfig{
	Name: "Article",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.String,
		},
		"isPublished": &graphql.Field{
			Type: graphql.Boolean,
		},
		"author": &graphql.Field{
			Type: blogAuthor,
		},
		"title": &graphql.Field{
			Type: graphql.String,
		},
		"body": &graphql.Field{
			Type: graphql.String,
		},
	},
})

var blogQuery = graphql.NewObject(graphql.ObjectConfig{
	Name: "Query",
	Fields: graphql.Fields{
		"article": &graphql.Field{
			Type: blogArticle,
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
		},
		"feed": &graphql.Field{
			Type: graphql.NewList(blogArticle),
		},
	},
})

var blogMutation = graphql.NewObject(graphql.ObjectConfig{
	Name: "Mutation",
	Fields: graphql.Fields{
		"writeArticle": &graphql.Field{
			Type: blogArticle,
			Args: graphql.FieldConfigArgument{
				"title": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
		},
	},
})

var blogSubscription = graphql.NewObject(graphql.ObjectConfig{
	Name: "Subscription",
	Fields: graphql.Fields{
		"articleSubscribe": &graphql.Field{
			Type: blogArticle,
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
		},
	},
})

var objectType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Object",
	IsTypeOf: func(p graphql.IsTypeOfParams) bool {
		return true
	},
})
var interfaceType = graphql.NewInterface(graphql.InterfaceConfig{
	Name: "Interface",
})
var unionType = graphql.NewUnion(graphql.UnionConfig{
	Name: "Union",
	Types: []*graphql.Object{
		objectType,
	},
})
var enumType = graphql.NewEnum(graphql.EnumConfig{
	Name: "Enum",
	Values: graphql.EnumValueConfigMap{
		"foo": &graphql.EnumValueConfig{},
	},
})
var inputObjectType = graphql.NewInputObject(graphql.InputObjectConfig{
	Name: "InputObject",
})

func init() {
	blogAuthor.AddFieldConfig("recentArticle", &graphql.Field{
		Type: blogArticle,
	})
}

func TestTypeSystem_DefinitionExample_DefinesAQueryOnlySchema(t *testing.T) {
	blogSchema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: blogQuery,
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}

	if blogSchema.QueryType() != blogQuery {
		t.Fatalf("expected blogSchema.GetQueryType() == blogQuery")
	}

	articleField, _ := blogQuery.Fields()["article"]
	if articleField == nil {
		t.Fatalf("articleField is nil")
	}
	articleFieldType := articleField.Type
	if articleFieldType != blogArticle {
		t.Fatalf("articleFieldType expected to equal blogArticle, got: %v", articleField.Type)
	}
	if articleFieldType.Name() != "Article" {
		t.Fatalf("articleFieldType.Name expected to equal `Article`, got: %v", articleField.Type.Name())
	}
	if articleField.Name != "article" {
		t.Fatalf("articleField.Name expected to equal `article`, got: %v", articleField.Name)
	}
	articleFieldTypeObject, ok := articleFieldType.(*graphql.Object)
	if !ok {
		t.Fatalf("expected articleFieldType to be graphql.Object`, got: %v", articleField)
	}

	// TODO: expose a Object.GetField(key string), instead of this ghetto way of accessing a field map?
	titleField := articleFieldTypeObject.Fields()["title"]
	if titleField == nil {
		t.Fatalf("titleField is nil")
	}
	if titleField.Name != "title" {
		t.Fatalf("titleField.Name expected to equal title, got: %v", titleField.Name)
	}
	if titleField.Type != graphql.String {
		t.Fatalf("titleField.Type expected to equal graphql.String, got: %v", titleField.Type)
	}
	if titleField.Type.Name() != "String" {
		t.Fatalf("titleField.Type.GetName() expected to equal `String`, got: %v", titleField.Type.Name())
	}

	authorField := articleFieldTypeObject.Fields()["author"]
	if authorField == nil {
		t.Fatalf("authorField is nil")
	}
	authorFieldObject, ok := authorField.Type.(*graphql.Object)
	if !ok {
		t.Fatalf("expected authorField.Type to be Object`, got: %v", authorField)
	}

	recentArticleField := authorFieldObject.Fields()["recentArticle"]
	if recentArticleField == nil {
		t.Fatalf("recentArticleField is nil")
	}
	if recentArticleField.Type != blogArticle {
		t.Fatalf("recentArticleField.Type expected to equal blogArticle, got: %v", recentArticleField.Type)
	}

	feedField := blogQuery.Fields()["feed"]
	feedFieldList, ok := feedField.Type.(*graphql.List)
	if !ok {
		t.Fatalf("expected feedFieldList to be List`, got: %v", authorField)
	}
	if feedFieldList.OfType != blogArticle {
		t.Fatalf("feedFieldList.OfType expected to equal blogArticle, got: %v", feedFieldList.OfType)
	}
	if feedField.Name != "feed" {
		t.Fatalf("feedField.Name expected to equal `feed`, got: %v", feedField.Name)
	}
}

func TestTypeSystem_DefinitionExample_DefinesAMutationScheme(t *testing.T) {
	blogSchema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query:    blogQuery,
		Mutation: blogMutation,
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}

	if blogSchema.MutationType() != blogMutation {
		t.Fatalf("expected blogSchema.GetMutationType() == blogMutation")
	}

	writeMutation, _ := blogMutation.Fields()["writeArticle"]
	if writeMutation == nil {
		t.Fatalf("writeMutation is nil")
	}
	writeMutationType := writeMutation.Type
	if writeMutationType != blogArticle {
		t.Fatalf("writeMutationType expected to equal blogArticle, got: %v", writeMutationType)
	}
	if writeMutationType.Name() != "Article" {
		t.Fatalf("writeMutationType.Name expected to equal `Article`, got: %v", writeMutationType.Name())
	}
	if writeMutation.Name != "writeArticle" {
		t.Fatalf("writeMutation.Name expected to equal `writeArticle`, got: %v", writeMutation.Name)
	}
}

func TestTypeSystem_DefinitionExample_DefinesASubscriptionScheme(t *testing.T) {
	blogSchema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query:        blogQuery,
		Subscription: blogSubscription,
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}

	if blogSchema.SubscriptionType() != blogSubscription {
		t.Fatalf("expected blogSchema.SubscriptionType() == blogSubscription")
	}

	subMutation, _ := blogSubscription.Fields()["articleSubscribe"]
	if subMutation == nil {
		t.Fatalf("subMutation is nil")
	}
	subMutationType := subMutation.Type
	if subMutationType != blogArticle {
		t.Fatalf("subMutationType expected to equal blogArticle, got: %v", subMutationType)
	}
	if subMutationType.Name() != "Article" {
		t.Fatalf("subMutationType.Name expected to equal `Article`, got: %v", subMutationType.Name())
	}
	if subMutation.Name != "articleSubscribe" {
		t.Fatalf("subMutation.Name expected to equal `articleSubscribe`, got: %v", subMutation.Name)
	}
}

func TestTypeSystem_DefinitionExample_IncludesNestedInputObjectsInTheMap(t *testing.T) {
	nestedInputObject := graphql.NewInputObject(graphql.InputObjectConfig{
		Name: "NestedInputObject",
		Fields: graphql.InputObjectConfigFieldMap{
			"value": &graphql.InputObjectFieldConfig{
				Type: graphql.String,
			},
		},
	})
	someInputObject := graphql.NewInputObject(graphql.InputObjectConfig{
		Name: "SomeInputObject",
		Fields: graphql.InputObjectConfigFieldMap{
			"nested": &graphql.InputObjectFieldConfig{
				Type: nestedInputObject,
			},
		},
	})
	someMutation := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeMutation",
		Fields: graphql.Fields{
			"mutateSomething": &graphql.Field{
				Type: blogArticle,
				Args: graphql.FieldConfigArgument{
					"input": &graphql.ArgumentConfig{
						Type: someInputObject,
					},
				},
			},
		},
	})
	someSubscription := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeSubscription",
		Fields: graphql.Fields{
			"subscribeToSomething": &graphql.Field{
				Type: blogArticle,
				Args: graphql.FieldConfigArgument{
					"input": &graphql.ArgumentConfig{
						Type: someInputObject,
					},
				},
			},
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query:        blogQuery,
		Mutation:     someMutation,
		Subscription: someSubscription,
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}
	if schema.Type("NestedInputObject") != nestedInputObject {
		t.Fatalf(`schema.GetType("NestedInputObject") expected to equal nestedInputObject, got: %v`, schema.Type("NestedInputObject"))
	}
}

func TestTypeSystem_DefinitionExample_IncludesInterfacesSubTypesInTheTypeMap(t *testing.T) {

	someInterface := graphql.NewInterface(graphql.InterfaceConfig{
		Name: "SomeInterface",
		Fields: graphql.Fields{
			"f": &graphql.Field{
				Type: graphql.Int,
			},
		},
	})

	someSubType := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeSubtype",
		Fields: graphql.Fields{
			"f": &graphql.Field{
				Type: graphql.Int,
			},
		},
		Interfaces: []*graphql.Interface{someInterface},
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			return true
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"iface": &graphql.Field{
					Type: someInterface,
				},
			},
		}),
		Types: []graphql.Type{someSubType},
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}
	if schema.Type("SomeSubtype") != someSubType {
		t.Fatalf(`schema.GetType("SomeSubtype") expected to equal someSubType, got: %v`, schema.Type("SomeSubtype"))
	}
}

func TestTypeSystem_DefinitionExample_IncludesInterfacesThunkSubtypesInTheTypeMap(t *testing.T) {

	someInterface := graphql.NewInterface(graphql.InterfaceConfig{
		Name: "SomeInterface",
		Fields: graphql.Fields{
			"f": &graphql.Field{
				Type: graphql.Int,
			},
		},
	})

	someSubType := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeSubtype",
		Fields: graphql.Fields{
			"f": &graphql.Field{
				Type: graphql.Int,
			},
		},
		Interfaces: (graphql.InterfacesThunk)(func() []*graphql.Interface {
			return []*graphql.Interface{someInterface}
		}),
		IsTypeOf: func(p graphql.IsTypeOfParams) bool {
			return true
		},
	})
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"iface": &graphql.Field{
					Type: someInterface,
				},
			},
		}),
		Types: []graphql.Type{someSubType},
	})
	if err != nil {
		t.Fatalf("unexpected error, got: %v", err)
	}
	if schema.Type("SomeSubtype") != someSubType {
		t.Fatalf(`schema.GetType("SomeSubtype") expected to equal someSubType, got: %v`, schema.Type("SomeSubtype"))
	}
}

func TestTypeSystem_DefinitionExample_StringifiesSimpleTypes(t *testing.T) {

	type Test struct {
		ttype    graphql.Type
		expected string
	}
	tests := []Test{
		{graphql.Int, "Int"},
		{blogArticle, "Article"},
		{interfaceType, "Interface"},
		{unionType, "Union"},
		{enumType, "Enum"},
		{inputObjectType, "InputObject"},
		{graphql.NewNonNull(graphql.Int), "Int!"},
		{graphql.NewList(graphql.Int), "[Int]"},
		{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
		{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
		{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
	}
	for _, test := range tests {
		ttypeStr := fmt.Sprintf("%v", test.ttype)
		if ttypeStr != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
	}
}

func TestTypeSystem_DefinitionExample_IdentifiesInputTypes(t *testing.T) {
	type Test struct {
		ttype    graphql.Type
		expected bool
	}
	tests := []Test{
		{graphql.Int, true},
		{objectType, false},
		{interfaceType, false},
		{unionType, false},
		{enumType, true},
		{inputObjectType, true},
	}
	for _, test := range tests {
		ttypeStr := fmt.Sprintf("%v", test.ttype)
		if graphql.IsInputType(test.ttype) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
		if graphql.IsInputType(graphql.NewList(test.ttype)) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
		if graphql.IsInputType(graphql.NewNonNull(test.ttype)) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
	}
}

func TestTypeSystem_DefinitionExample_IdentifiesOutputTypes(t *testing.T) {
	type Test struct {
		ttype    graphql.Type
		expected bool
	}
	tests := []Test{
		{graphql.Int, true},
		{objectType, true},
		{interfaceType, true},
		{unionType, true},
		{enumType, true},
		{inputObjectType, false},
	}
	for _, test := range tests {
		ttypeStr := fmt.Sprintf("%v", test.ttype)
		if graphql.IsOutputType(test.ttype) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
		if graphql.IsOutputType(graphql.NewList(test.ttype)) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
		if graphql.IsOutputType(graphql.NewNonNull(test.ttype)) != test.expected {
			t.Fatalf(`expected %v , got: %v`, test.expected, ttypeStr)
		}
	}
}

func TestTypeSystem_DefinitionExample_ProhibitsNestingNonNullInsideNonNull(t *testing.T) {
	ttype := graphql.NewNonNull(graphql.NewNonNull(graphql.Int))
	expected := `Can only create NonNull of a Nullable Type but got: Int!.`
	if ttype.Error().Error() != expected {
		t.Fatalf(`expected %v , got: %v`, expected, ttype.Error())
	}
}
func TestTypeSystem_DefinitionExample_ProhibitsNilInNonNull(t *testing.T) {
	ttype := graphql.NewNonNull(nil)
	expected := `Can only create NonNull of a Nullable Type but got: <nil>.`
	if ttype.Error().Error() != expected {
		t.Fatalf(`expected %v , got: %v`, expected, ttype.Error())
	}
}
func TestTypeSystem_DefinitionExample_ProhibitsNilTypeInUnions(t *testing.T) {
	ttype := graphql.NewUnion(graphql.UnionConfig{
		Name:  "BadUnion",
		Types: []*graphql.Object{nil},
	})
	ttype.Types()
	expected := `BadUnion may only contain Object types, it cannot contain: <nil>.`
	if ttype.Error().Error() != expected {
		t.Fatalf(`expected %v , got: %v`, expected, ttype.Error())
	}
}
func TestTypeSystem_DefinitionExample_DoesNotMutatePassedFieldDefinitions(t *testing.T) {
	fields := graphql.Fields{
		"field1": &graphql.Field{
			Type: graphql.String,
		},
		"field2": &graphql.Field{
			Type: graphql.String,
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
		},
	}
	testObject1 := graphql.NewObject(graphql.ObjectConfig{
		Name:   "Test1",
		Fields: fields,
	})
	testObject2 := graphql.NewObject(graphql.ObjectConfig{
		Name:   "Test2",
		Fields: fields,
	})
	if !reflect.DeepEqual(testObject1.Fields(), testObject2.Fields()) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(testObject1.Fields(), testObject2.Fields()))
	}

	expectedFields := graphql.Fields{
		"field1": &graphql.Field{
			Type: graphql.String,
		},
		"field2": &graphql.Field{
			Type: graphql.String,
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
		},
	}
	if !reflect.DeepEqual(fields, expectedFields) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expectedFields, fields))
	}

	inputFields := graphql.InputObjectConfigFieldMap{
		"field1": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"field2": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
	}
	expectedInputFields := graphql.InputObjectConfigFieldMap{
		"field1": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"field2": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
	}
	testInputObject1 := graphql.NewInputObject(graphql.InputObjectConfig{
		Name:   "Test1",
		Fields: inputFields,
	})
	testInputObject2 := graphql.NewInputObject(graphql.InputObjectConfig{
		Name:   "Test2",
		Fields: inputFields,
	})
	if !reflect.DeepEqual(testInputObject1.Fields(), testInputObject2.Fields()) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(testInputObject1.Fields(), testInputObject2.Fields()))
	}
	if !reflect.DeepEqual(inputFields, expectedInputFields) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expectedInputFields, fields))
	}
}

func TestTypeSystem_DefinitionExample_IncludesFieldsThunk(t *testing.T) {
	var someObject *graphql.Object
	someObject = graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeObject",
		Fields: (graphql.FieldsThunk)(func() graphql.Fields {
			return graphql.Fields{
				"f": &graphql.Field{
					Type: graphql.Int,
				},
				"s": &graphql.Field{
					Type: someObject,
				},
			}
		}),
	})
	fieldMap := someObject.Fields()
	if !reflect.DeepEqual(fieldMap["s"].Type, someObject) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(fieldMap["s"].Type, someObject))
	}
}

func TestTypeSystem_DefinitionExampe_AllowsCyclicFieldTypes(t *testing.T) {
	personType := graphql.NewObject(graphql.ObjectConfig{
		Name: "Person",
		Fields: (graphql.FieldsThunk)(func() graphql.Fields {
			return graphql.Fields{
				"name": &graphql.Field{
					Type: graphql.String,
				},
				"bestFriend": &graphql.Field{
					Type: personType,
				},
			}
		}),
	})

	fieldMap := personType.Fields()
	if !reflect.DeepEqual(fieldMap["name"].Type, graphql.String) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(fieldMap["bestFriend"].Type, personType))
	}

}

func TestTypeSystem_DefinitionExample_CanAddInputObjectField(t *testing.T) {
	io := graphql.NewInputObject(graphql.InputObjectConfig{
		Name: "inputObject",
		Fields: graphql.InputObjectConfigFieldMap{
			"value": &graphql.InputObjectFieldConfig{
				Type: graphql.String,
			},
		},
	})
	io.AddFieldConfig("newValue", &graphql.InputObjectFieldConfig{
		Type: graphql.Int,
	})
	fieldMap := io.Fields()

	if len(fieldMap) < 2 {
		t.Fatalf("Unexpected result, inputObject should have two fields, has %d", len(fieldMap))
	}
	if _, ok := fieldMap["value"]; !ok {
		t.Fatal("Unexpected result, inputObject should have a field named 'value'")
	}
	if _, ok := fieldMap["newValue"]; !ok {
		t.Fatal("Unexpected result, inputObject should have a field named 'newValue'")
	}
}

func TestTypeSystem_DefinitionExample_IncludesUnionTypesThunk(t *testing.T) {
	someObject := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeObject",
		Fields: graphql.Fields{
			"f": &graphql.Field{
				Type: graphql.Int,
			},
		},
	})

	someOtherObject := graphql.NewObject(graphql.ObjectConfig{
		Name: "SomeOtherObject",
		Fields: graphql.Fields{
			"g": &graphql.Field{
				Type: graphql.Int,
			},
		},
	})

	someUnion := graphql.NewUnion(graphql.UnionConfig{
		Name: "SomeUnion",
		Types: (graphql.UnionTypesThunk)(func() []*graphql.Object {
			return []*graphql.Object{someObject, someOtherObject}
		}),
		ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object {
			return nil
		},
	})

	unionTypes := someUnion.Types()

	if someUnion.Error() != nil {
		t.Fatalf("unexpected error, got: %v", someUnion.Error().Error())
	}
	if len(unionTypes) != 2 {
		t.Fatalf("Unexpected result, someUnion should have two unionTypes, has %d", len(unionTypes))
	}
}

func TestTypeSystem_DefinitionExample_HandlesInvalidUnionTypes(t *testing.T) {
	someUnion := graphql.NewUnion(graphql.UnionConfig{
		Name: "SomeUnion",
		Types: (graphql.InterfacesThunk)(func() []*graphql.Interface {
			return []*graphql.Interface{}
		}),
		ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object {
			return nil
		},
	})

	unionTypes := someUnion.Types()
	expected := "Unknown Union.Types type: graphql.InterfacesThunk"

	if someUnion.Error().Error() != expected {
		t.Fatalf("Unexpected error, got: %v, want: %v", someUnion.Error().Error(), expected)
	}
	if unionTypes != nil {
		t.Fatalf("Unexpected result, got: %v, want: nil", unionTypes)
	}
}

func TestIsAbstractType(t *testing.T) {
	tests := []struct {
		name     string
		ttype    interface{}
		expected bool
	}{
		{
			name:     "Interface type should return true",
			ttype:    graphql.NewInterface(graphql.InterfaceConfig{Name: "TestInterface"}),
			expected: true,
		},
		{
			name:     "Union type should return true",
			ttype:    graphql.NewUnion(graphql.UnionConfig{Name: "TestUnion"}),
			expected: true,
		},
		{
			name:     "Scalar type should return false",
			ttype:    graphql.NewScalar(graphql.ScalarConfig{Name: "TestScalar", Serialize: func(v interface{}) interface{} { return v }}),
			expected: false,
		},
		{
			name:     "Object type should return false",
			ttype:    graphql.NewObject(graphql.ObjectConfig{Name: "TestObject"}),
			expected: false,
		},
		{
			name:     "Enum type should return false",
			ttype:    graphql.NewEnum(graphql.EnumConfig{Name: "TestEnum", Values: graphql.EnumValueConfigMap{"A": &graphql.EnumValueConfig{}}}),
			expected: false,
		},
		{
			name:     "InputObject type should return false",
			ttype:    graphql.NewInputObject(graphql.InputObjectConfig{Name: "TestInputObject"}),
			expected: false,
		},
		{
			name:     "List type should return false",
			ttype:    graphql.NewList(graphql.NewScalar(graphql.ScalarConfig{Name: "TestScalar", Serialize: func(v interface{}) interface{} { return v }})),
			expected: false,
		},
		{
			name:     "NonNull type should return false",
			ttype:    graphql.NewNonNull(graphql.NewScalar(graphql.ScalarConfig{Name: "TestScalar", Serialize: func(v interface{}) interface{} { return v }})),
			expected: false,
		},
		{
			name:     "nil type should return false",
			ttype:    nil,
			expected: false,
		},
		{
			name:     "string type should return false",
			ttype:    "not a type",
			expected: false,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			result := graphql.IsAbstractType(tt.ttype)
			if result != tt.expected {
				t.Errorf("IsAbstractType(%v) = %v; want %v", tt.ttype, result, tt.expected)
			}
		})
	}
}

func TestGetNullable(t *testing.T) {
	scalarType := graphql.NewScalar(graphql.ScalarConfig{Name: "TestScalar", Serialize: func(v interface{}) interface{} { return v }})
	objectType := graphql.NewObject(graphql.ObjectConfig{Name: "TestObject"})
	listType := graphql.NewList(scalarType)

	tests := []struct {
		name     string
		ttype    graphql.Type
		expected graphql.Type
	}{
		{
			name:     "NonNull Scalar should return Scalar",
			ttype:    graphql.NewNonNull(scalarType),
			expected: scalarType,
		},
		{
			name:     "NonNull Object should return Object",
			ttype:    graphql.NewNonNull(objectType),
			expected: objectType,
		},
		{
			name:     "NonNull List should return List",
			ttype:    graphql.NewNonNull(listType),
			expected: listType,
		},
		{
			name:     "Scalar should return Scalar",
			ttype:    scalarType,
			expected: scalarType,
		},
		{
			name:     "Object should return Object",
			ttype:    objectType,
			expected: objectType,
		},
		{
			name:     "List should return List",
			ttype:    listType,
			expected: listType,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			result := graphql.GetNullable(tt.ttype)
			if result != tt.expected {
				t.Errorf("GetNullable(%v) = %v; want %v", tt.ttype, result, tt.expected)
			}
		})
	}
}

func TestNewScalar(t *testing.T) {
	tests := []struct {
		name          string
		config        graphql.ScalarConfig
		expectedError bool
	}{
		{
			name: "empty name should error",
			config: graphql.ScalarConfig{
				Name:      "",
				Serialize: func(v interface{}) interface{} { return v },
			},
			expectedError: true,
		},
		{
			name: "invalid name starting with number should error",
			config: graphql.ScalarConfig{
				Name:      "123Invalid",
				Serialize: func(v interface{}) interface{} { return v },
			},
			expectedError: true,
		},
		{
			name: "invalid name with special characters should error",
			config: graphql.ScalarConfig{
				Name:      "Invalid-Name",
				Serialize: func(v interface{}) interface{} { return v },
			},
			expectedError: true,
		},
		{
			name: "valid scalar with underscore should succeed",
			config: graphql.ScalarConfig{
				Name:      "_ValidScalar",
				Serialize: func(v interface{}) interface{} { return v },
			},
			expectedError: false,
		},
		{
			name: "valid scalar with alphanumeric should succeed",
			config: graphql.ScalarConfig{
				Name:      "ValidScalar123",
				Serialize: func(v interface{}) interface{} { return v },
			},
			expectedError: false,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			scalar := graphql.NewScalar(tt.config)
			if tt.expectedError && scalar.Error() == nil {
				t.Errorf("NewScalar(%v) expected error but got none", tt.config.Name)
			}
			if !tt.expectedError && scalar.Error() != nil {
				t.Errorf("NewScalar(%v) unexpected error: %v", tt.config.Name, scalar.Error())
			}
		})
	}
}


================================================
FILE: directives.go
================================================
package graphql

const (
	// Operations
	DirectiveLocationQuery              = "QUERY"
	DirectiveLocationMutation           = "MUTATION"
	DirectiveLocationSubscription       = "SUBSCRIPTION"
	DirectiveLocationField              = "FIELD"
	DirectiveLocationFragmentDefinition = "FRAGMENT_DEFINITION"
	DirectiveLocationFragmentSpread     = "FRAGMENT_SPREAD"
	DirectiveLocationInlineFragment     = "INLINE_FRAGMENT"

	// Schema Definitions
	DirectiveLocationSchema               = "SCHEMA"
	DirectiveLocationScalar               = "SCALAR"
	DirectiveLocationObject               = "OBJECT"
	DirectiveLocationFieldDefinition      = "FIELD_DEFINITION"
	DirectiveLocationArgumentDefinition   = "ARGUMENT_DEFINITION"
	DirectiveLocationInterface            = "INTERFACE"
	DirectiveLocationUnion                = "UNION"
	DirectiveLocationEnum                 = "ENUM"
	DirectiveLocationEnumValue            = "ENUM_VALUE"
	DirectiveLocationInputObject          = "INPUT_OBJECT"
	DirectiveLocationInputFieldDefinition = "INPUT_FIELD_DEFINITION"
)

// DefaultDeprecationReason Constant string used for default reason for a deprecation.
const DefaultDeprecationReason = "No longer supported"

// SpecifiedRules The full list of specified directives.
var SpecifiedDirectives = []*Directive{
	IncludeDirective,
	SkipDirective,
	DeprecatedDirective,
}

// Directive structs are used by the GraphQL runtime as a way of modifying execution
// behavior. Type system creators will usually not create these directly.
type Directive struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Locations   []string    `json:"locations"`
	Args        []*Argument `json:"args"`

	err error
}

// DirectiveConfig options for creating a new GraphQLDirective
type DirectiveConfig struct {
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Locations   []string            `json:"locations"`
	Args        FieldConfigArgument `json:"args"`
}

func NewDirective(config DirectiveConfig) *Directive {
	dir := &Directive{}

	// Ensure directive is named
	if dir.err = invariant(config.Name != "", "Directive must be named."); dir.err != nil {
		return dir
	}

	// Ensure directive name is valid
	if dir.err = assertValidName(config.Name); dir.err != nil {
		return dir
	}

	// Ensure locations are provided for directive
	if dir.err = invariant(len(config.Locations) > 0, "Must provide locations for directive."); dir.err != nil {
		return dir
	}

	args := []*Argument{}

	for argName, argConfig := range config.Args {
		if dir.err = assertValidName(argName); dir.err != nil {
			return dir
		}
		args = append(args, &Argument{
			PrivateName:        argName,
			PrivateDescription: argConfig.Description,
			Type:               argConfig.Type,
			DefaultValue:       argConfig.DefaultValue,
		})
	}

	dir.Name = config.Name
	dir.Description = config.Description
	dir.Locations = config.Locations
	dir.Args = args
	return dir
}

// IncludeDirective is used to conditionally include fields or fragments.
var IncludeDirective = NewDirective(DirectiveConfig{
	Name: "include",
	Description: "Directs the executor to include this field or fragment only when " +
		"the `if` argument is true.",
	Locations: []string{
		DirectiveLocationField,
		DirectiveLocationFragmentSpread,
		DirectiveLocationInlineFragment,
	},
	Args: FieldConfigArgument{
		"if": &ArgumentConfig{
			Type:        NewNonNull(Boolean),
			Description: "Included when true.",
		},
	},
})

// SkipDirective Used to conditionally skip (exclude) fields or fragments.
var SkipDirective = NewDirective(DirectiveConfig{
	Name: "skip",
	Description: "Directs the executor to skip this field or fragment when the `if` " +
		"argument is true.",
	Args: FieldConfigArgument{
		"if": &ArgumentConfig{
			Type:        NewNonNull(Boolean),
			Description: "Skipped when true.",
		},
	},
	Locations: []string{
		DirectiveLocationField,
		DirectiveLocationFragmentSpread,
		DirectiveLocationInlineFragment,
	},
})

// DeprecatedDirective  Used to declare element of a GraphQL schema as deprecated.
var DeprecatedDirective = NewDirective(DirectiveConfig{
	Name:        "deprecated",
	Description: "Marks an element of a GraphQL schema as no longer supported.",
	Args: FieldConfigArgument{
		"reason": &ArgumentConfig{
			Type: String,
			Description: "Explains why this element was deprecated, usually also including a " +
				"suggestion for how to access supported similar data. Formatted" +
				"in [Markdown](https://daringfireball.net/projects/markdown/).",
			DefaultValue: DefaultDeprecationReason,
		},
	},
	Locations: []string{
		DirectiveLocationFieldDefinition,
		DirectiveLocationEnumValue,
	},
})


================================================
FILE: directives_test.go
================================================
package graphql_test

import (
	"errors"
	"testing"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/gqlerrors"
	"github.com/graphql-go/graphql/testutil"
)

var directivesTestSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
	Query: graphql.NewObject(graphql.ObjectConfig{
		Name: "TestType",
		Fields: graphql.Fields{
			"a": &graphql.Field{
				Type: graphql.String,
			},
			"b": &graphql.Field{
				Type: graphql.String,
			},
		},
	}),
})

var directivesTestData map[string]interface{} = map[string]interface{}{
	"a": func() interface{} { return "a" },
	"b": func() interface{} { return "b" },
}

func executeDirectivesTestQuery(t *testing.T, doc string) *graphql.Result {
	ast := testutil.TestParse(t, doc)
	ep := graphql.ExecuteParams{
		Schema: directivesTestSchema,
		AST:    ast,
		Root:   directivesTestData,
	}
	return testutil.TestExecute(t, ep)
}

func TestDirectives_DirectivesMustBeNamed(t *testing.T) {
	invalidDirective := graphql.NewDirective(graphql.DirectiveConfig{
		Locations: []string{
			graphql.DirectiveLocationField,
		},
	})
	_, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "TestType",
			Fields: graphql.Fields{
				"a": &graphql.Field{
					Type: graphql.String,
				},
			},
		}),
		Directives: []*graphql.Directive{invalidDirective},
	})
	actualErr := gqlerrors.FormatError(err)
	expectedErr := gqlerrors.FormatError(errors.New("Directive must be named."))
	if !testutil.EqualFormattedError(expectedErr, actualErr) {
		t.Fatalf("Expected error to be equal, got: %v", testutil.Diff(expectedErr, actualErr))
	}
}

func TestDirectives_DirectiveNameMustBeValid(t *testing.T) {
	invalidDirective := graphql.NewDirective(graphql.DirectiveConfig{
		Name: "123invalid name",
		Locations: []string{
			graphql.DirectiveLocationField,
		},
	})
	_, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "TestType",
			Fields: graphql.Fields{
				"a": &graphql.Field{
					Type: graphql.String,
				},
			},
		}),
		Directives: []*graphql.Directive{invalidDirective},
	})
	actualErr := gqlerrors.FormatError(err)
	expectedErr := gqlerrors.FormatError(errors.New(`Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "123invalid name" does not.`))
	if !testutil.EqualFormattedError(expectedErr, actualErr) {
		t.Fatalf("Expected error to be equal, got: %v", testutil.Diff(expectedErr, actualErr))
	}
}

func TestDirectives_DirectiveNameMustProvideLocations(t *testing.T) {
	invalidDirective := graphql.NewDirective(graphql.DirectiveConfig{
		Name: "skip",
	})
	_, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "TestType",
			Fields: graphql.Fields{
				"a": &graphql.Field{
					Type: graphql.String,
				},
			},
		}),
		Directives: []*graphql.Directive{invalidDirective},
	})
	actualErr := gqlerrors.FormatError(err)
	expectedErr := gqlerrors.FormatError(errors.New(`Must provide locations for directive.`))
	if !testutil.EqualFormattedError(expectedErr, actualErr) {
		t.Fatalf("Expected error to be equal, got: %v", testutil.Diff(expectedErr, actualErr))
	}
}

func TestDirectives_DirectiveArgNamesMustBeValid(t *testing.T) {
	invalidDirective := graphql.NewDirective(graphql.DirectiveConfig{
		Name: "skip",
		Description: "Directs the executor to skip this field or fragment when the `if` " +
			"argument is true.",
		Args: graphql.FieldConfigArgument{
			"123if": &graphql.ArgumentConfig{
				Type:        graphql.NewNonNull(graphql.Boolean),
				Description: "Skipped when true.",
			},
		},
		Locations: []string{
			graphql.DirectiveLocationField,
			graphql.DirectiveLocationFragmentSpread,
			graphql.DirectiveLocationInlineFragment,
		},
	})
	_, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "TestType",
			Fields: graphql.Fields{
				"a": &graphql.Field{
					Type: graphql.String,
				},
			},
		}),
		Directives: []*graphql.Directive{invalidDirective},
	})
	actualErr := gqlerrors.FormatError(err)
	expectedErr := gqlerrors.FormatError(errors.New(`Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "123if" does not.`))
	if !testutil.EqualFormattedError(expectedErr, actualErr) {
		t.Fatalf("Expected error to be equal, got: %v", testutil.Diff(expectedErr, actualErr))
	}
}

func TestDirectivesWorksWithoutDirectives(t *testing.T) {
	query := `{ a, b }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnScalarsIfTrueIncludesScalar(t *testing.T) {
	query := `{ a, b @include(if: true) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnScalarsIfFalseOmitsOnScalar(t *testing.T) {
	query := `{ a, b @include(if: false) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnScalarsUnlessFalseIncludesScalar(t *testing.T) {
	query := `{ a, b @skip(if: false) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnScalarsUnlessTrueOmitsScalar(t *testing.T) {
	query := `{ a, b @skip(if: true) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnFragmentSpreadsIfFalseOmitsFragmentSpread(t *testing.T) {
	query := `
        query Q {
          a
          ...Frag @include(if: false)
        }
        fragment Frag on TestType {
          b
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnFragmentSpreadsIfTrueIncludesFragmentSpread(t *testing.T) {
	query := `
        query Q {
          a
          ...Frag @include(if: true)
        }
        fragment Frag on TestType {
          b
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnFragmentSpreadsUnlessFalseIncludesFragmentSpread(t *testing.T) {
	query := `
        query Q {
          a
          ...Frag @skip(if: false)
        }
        fragment Frag on TestType {
          b
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnFragmentSpreadsUnlessTrueOmitsFragmentSpread(t *testing.T) {
	query := `
        query Q {
          a
          ...Frag @skip(if: true)
        }
        fragment Frag on TestType {
          b
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnInlineFragmentIfFalseOmitsInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... on TestType @include(if: false) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnInlineFragmentIfTrueIncludesInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... on TestType @include(if: true) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnInlineFragmentUnlessFalseIncludesInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... on TestType @skip(if: false) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnInlineFragmentUnlessTrueIncludesInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... on TestType @skip(if: true) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnAnonymousInlineFragmentIfFalseOmitsAnonymousInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... @include(if: false) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnAnonymousInlineFragmentIfTrueIncludesAnonymousInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... @include(if: true) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnAnonymousInlineFragmentUnlessFalseIncludesAnonymousInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... @skip(if: false) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksOnAnonymousInlineFragmentUnlessTrueIncludesAnonymousInlineFragment(t *testing.T) {
	query := `
        query Q {
          a
          ... @skip(if: true) {
            b
          }
        }
	`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndNoSkip(t *testing.T) {
	query := `{ a, b @include(if: true) @skip(if: false) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
			"b": "b",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndSkip(t *testing.T) {
	query := `{ a, b @include(if: true) @skip(if: true) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeAndSkip(t *testing.T) {
	query := `{ a, b @include(if: false) @skip(if: true) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeOrSkip(t *testing.T) {
	query := `{ a, b @include(if: false) @skip(if: false) }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"a": "a",
		},
	}
	result := executeDirectivesTestQuery(t, query)
	if !testutil.EqualResults(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}


================================================
FILE: enum_type_test.go
================================================
package graphql_test

import (
	"reflect"
	"testing"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/gqlerrors"
	"github.com/graphql-go/graphql/language/location"
	"github.com/graphql-go/graphql/testutil"
)

var enumTypeTestColorType = graphql.NewEnum(graphql.EnumConfig{
	Name: "Color",
	Values: graphql.EnumValueConfigMap{
		"RED": &graphql.EnumValueConfig{
			Value: 0,
		},
		"GREEN": &graphql.EnumValueConfig{
			Value: 1,
		},
		"BLUE": &graphql.EnumValueConfig{
			Value: 2,
		},
	},
})
var enumTypeTestQueryType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Query",
	Fields: graphql.Fields{
		"colorEnum": &graphql.Field{
			Type: enumTypeTestColorType,
			Args: graphql.FieldConfigArgument{
				"fromEnum": &graphql.ArgumentConfig{
					Type: enumTypeTestColorType,
				},
				"fromInt": &graphql.ArgumentConfig{
					Type: graphql.Int,
				},
				"fromString": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if fromInt, ok := p.Args["fromInt"]; ok {
					return fromInt, nil
				}
				if fromString, ok := p.Args["fromString"]; ok {
					return fromString, nil
				}
				if fromEnum, ok := p.Args["fromEnum"]; ok {
					return fromEnum, nil
				}
				return nil, nil
			},
		},
		"colorInt": &graphql.Field{
			Type: graphql.Int,
			Args: graphql.FieldConfigArgument{
				"fromEnum": &graphql.ArgumentConfig{
					Type: enumTypeTestColorType,
				},
				"fromInt": &graphql.ArgumentConfig{
					Type: graphql.Int,
				},
			},
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if fromInt, ok := p.Args["fromInt"]; ok {
					return fromInt, nil
				}
				if fromEnum, ok := p.Args["fromEnum"]; ok {
					return fromEnum, nil
				}
				return nil, nil
			},
		},
	},
})
var enumTypeTestMutationType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Mutation",
	Fields: graphql.Fields{
		"favoriteEnum": &graphql.Field{
			Type: enumTypeTestColorType,
			Args: graphql.FieldConfigArgument{
				"color": &graphql.ArgumentConfig{
					Type: enumTypeTestColorType,
				},
			},
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if color, ok := p.Args["color"]; ok {
					return color, nil
				}
				return nil, nil
			},
		},
	},
})

var enumTypeTestSubscriptionType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Subscription",
	Fields: graphql.Fields{
		"subscribeToEnum": &graphql.Field{
			Type: enumTypeTestColorType,
			Args: graphql.FieldConfigArgument{
				"color": &graphql.ArgumentConfig{
					Type: enumTypeTestColorType,
				},
			},
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if color, ok := p.Args["color"]; ok {
					return color, nil
				}
				return nil, nil
			},
		},
	},
})

var enumTypeTestSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
	Query:        enumTypeTestQueryType,
	Mutation:     enumTypeTestMutationType,
	Subscription: enumTypeTestSubscriptionType,
})

func executeEnumTypeTest(t *testing.T, query string) *graphql.Result {
	result := g(t, graphql.Params{
		Schema:        enumTypeTestSchema,
		RequestString: query,
	})
	return result
}
func executeEnumTypeTestWithParams(t *testing.T, query string, params map[string]interface{}) *graphql.Result {
	result := g(t, graphql.Params{
		Schema:         enumTypeTestSchema,
		RequestString:  query,
		VariableValues: params,
	})
	return result
}
func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInput(t *testing.T) {
	query := "{ colorInt(fromEnum: GREEN) }"
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorInt": 1,
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_EnumMayBeOutputType(t *testing.T) {
	query := "{ colorEnum(fromInt: 1) }"
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": "GREEN",
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_EnumMayBeBothInputAndOutputType(t *testing.T) {
	query := "{ colorEnum(fromEnum: GREEN) }"
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": "GREEN",
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals(t *testing.T) {
	query := `{ colorEnum(fromEnum: "GREEN") }`
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: "Argument \"fromEnum\" has invalid value \"GREEN\".\nExpected type \"Color\", found \"GREEN\".",
				Locations: []location.SourceLocation{
					{Line: 1, Column: 23},
				},
			},
		},
	}
	result := executeEnumTypeTest(t, query)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptIncorrectInternalValue(t *testing.T) {
	query := `{ colorEnum(fromString: "GREEN") }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": nil,
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLiteral(t *testing.T) {
	query := `{ colorEnum(fromEnum: 1) }`
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: "Argument \"fromEnum\" has invalid value 1.\nExpected type \"Color\", found 1.",
				Locations: []location.SourceLocation{
					{Line: 1, Column: 23},
				},
			},
		},
	}
	result := executeEnumTypeTest(t, query)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt(t *testing.T) {
	query := `{ colorEnum(fromInt: GREEN) }`
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: "Argument \"fromInt\" has invalid value GREEN.\nExpected type \"Int\", found GREEN.",
				Locations: []location.SourceLocation{
					{Line: 1, Column: 23},
				},
			},
		},
	}
	result := executeEnumTypeTest(t, query)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_AcceptsJSONStringAsEnumVariable(t *testing.T) {
	query := `query test($color: Color!) { colorEnum(fromEnum: $color) }`
	params := map[string]interface{}{
		"color": "BLUE",
	}
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": "BLUE",
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToMutations(t *testing.T) {
	query := `mutation x($color: Color!) { favoriteEnum(color: $color) }`
	params := map[string]interface{}{
		"color": "GREEN",
	}
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"favoriteEnum": "GREEN",
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToSubscriptions(t *testing.T) {
	query := `subscription x($color: Color!) { subscribeToEnum(color: $color) }`
	params := map[string]interface{}{
		"color": "GREEN",
	}
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"subscribeToEnum": "GREEN",
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable(t *testing.T) {
	query := `query test($color: Color!) { colorEnum(fromEnum: $color) }`
	params := map[string]interface{}{
		"color": 2,
	}
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: "Variable \"$color\" got invalid value 2.\nExpected type \"Color\", found \"2\".",
				Locations: []location.SourceLocation{
					{Line: 1, Column: 12},
				},
			},
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput(t *testing.T) {
	query := `query test($color: String!) { colorEnum(fromEnum: $color) }`
	params := map[string]interface{}{
		"color": "BLUE",
	}
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: `Variable "$color" of type "String!" used in position expecting type "Color".`,
			},
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumInput(t *testing.T) {
	query := `query test($color: Int!) { colorEnum(fromEnum: $color) }`
	params := map[string]interface{}{
		"color": 2,
	}
	expected := &graphql.Result{
		Data: nil,
		Errors: []gqlerrors.FormattedError{
			{
				Message: `Variable "$color" of type "Int!" used in position expecting type "Color".`,
			},
		},
	}
	result := executeEnumTypeTestWithParams(t, query, params)
	if !testutil.EqualErrorMessage(expected, result, 0) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_EnumValueMayHaveAnInternalValueOfZero(t *testing.T) {
	query := `{
        colorEnum(fromEnum: RED)
        colorInt(fromEnum: RED)
      }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": "RED",
			"colorInt":  0,
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}
func TestTypeSystem_EnumValues_EnumValueMayBeNullable(t *testing.T) {
	query := `{
        colorEnum
        colorInt
      }`
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"colorEnum": nil,
			"colorInt":  nil,
		},
	}
	result := executeEnumTypeTest(t, query)
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_EnumValueMayBePointer(t *testing.T) {
	var enumTypeTestSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"query": &graphql.Field{
					Type: graphql.NewObject(graphql.ObjectConfig{
						Name: "query",
						Fields: graphql.Fields{
							"color": &graphql.Field{
								Type: enumTypeTestColorType,
							},
							"foo": &graphql.Field{
								Description: "foo field",
								Type:        graphql.Int,
							},
						},
					}),
					Resolve: func(_ graphql.ResolveParams) (interface{}, error) {
						one := 1
						return struct {
							Color *int `graphql:"color"`
							Foo   *int `graphql:"foo"`
						}{&one, &one}, nil
					},
				},
			},
		}),
	})
	query := "{ query { color foo } }"
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"query": map[string]interface{}{
				"color": "GREEN",
				"foo":   1}}}
	result := g(t, graphql.Params{
		Schema:        enumTypeTestSchema,
		RequestString: query,
	})
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}

func TestTypeSystem_EnumValues_EnumValueMayBeNilPointer(t *testing.T) {
	var enumTypeTestSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"query": &graphql.Field{
					Type: graphql.NewObject(graphql.ObjectConfig{
						Name: "query",
						Fields: graphql.Fields{
							"color": &graphql.Field{
								Type: enumTypeTestColorType,
							},
						},
					}),
					Resolve: func(_ graphql.ResolveParams) (interface{}, error) {
						return struct {
							Color *int `graphql:"color"`
						}{nil}, nil
					},
				},
			},
		}),
	})
	query := "{ query { color } }"
	expected := &graphql.Result{
		Data: map[string]interface{}{
			"query": map[string]interface{}{
				"color": nil,
			}},
	}
	result := g(t, graphql.Params{
		Schema:        enumTypeTestSchema,
		RequestString: query,
	})
	if !reflect.DeepEqual(expected, result) {
		t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result))
	}
}


================================================
FILE: examples/concurrent-resolvers/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
)

type Foo struct {
	Name string
}

var FieldFooType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Foo",
	Fields: graphql.Fields{
		"name": &graphql.Field{Type: graphql.String},
	},
})

type Bar struct {
	Name string
}

var FieldBarType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Bar",
	Fields: graphql.Fields{
		"name": &graphql.Field{Type: graphql.String},
	},
})

// QueryType fields: `concurrentFieldFoo` and `concurrentFieldBar` are resolved
// concurrently because they belong to the same field-level and their `Resolve`
// function returns a function (thunk).
var QueryType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Query",
	Fields: graphql.Fields{
		"concurrentFieldFoo": &graphql.Field{
			Type: FieldFooType,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				var foo = Foo{Name: "Foo's name"}
				return func() (interface{}, error) {
					return &foo, nil
				}, nil
			},
		},
		"concurrentFieldBar": &graphql.Field{
			Type: FieldBarType,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				type result struct {
					data interface{}
					err  error
				}
				ch := make(chan *result, 1)
				go func() {
					defer close(ch)
					bar := &Bar{Name: "Bar's name"}
					ch <- &result{data: bar, err: nil}
				}()
				return func() (interface{}, error) {
					r := <-ch
					return r.data, r.err
				}, nil
			},
		},
	},
})

func main() {
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: QueryType,
	})
	if err != nil {
		log.Fatal(err)
	}
	query := `
		query {
			concurrentFieldFoo {
				name
			}
			concurrentFieldBar {
				name
			}
		}
	`
	result := graphql.Do(graphql.Params{
		RequestString: query,
		Schema:        schema,
	})
	b, err := json.Marshal(result)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s", b)
	/*
		{
		  "data": {
		    "concurrentFieldBar": {
		      "name": "Bar's name"
		    },
		    "concurrentFieldFoo": {
		      "name": "Foo's name"
		    }
		  }
		}
	*/
}


================================================
FILE: examples/context/main.go
================================================
package main

import (
	"context"
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/graphql-go/graphql"
)

var Schema graphql.Schema

var userType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "User",
		Fields: graphql.Fields{
			"id": &graphql.Field{
				Type: graphql.String,
			},
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	},
)

var queryType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "Query",
		Fields: graphql.Fields{
			"me": &graphql.Field{
				Type: userType,
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					return p.Context.Value("currentUser"), nil
				},
			},
		},
	})

func graphqlHandler(w http.ResponseWriter, r *http.Request) {
	user := struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	}{1, "cool user"}
	result := graphql.Do(graphql.Params{
		Schema:        Schema,
		RequestString: r.URL.Query().Get("query"),
		Context:       context.WithValue(context.Background(), "currentUser", user),
	})
	if len(result.Errors) > 0 {
		log.Printf("wrong result, unexpected errors: %v", result.Errors)
		return
	}
	json.NewEncoder(w).Encode(result)
}

func main() {
	http.HandleFunc("/graphql", graphqlHandler)
	fmt.Println("Now server is running on port 8080")
	fmt.Println("Test with Get      : curl -g 'http://localhost:8080/graphql?query={me{id,name}}'")
	http.ListenAndServe(":8080", nil)
}

func init() {
	s, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: queryType,
	})
	if err != nil {
		log.Fatalf("failed to create schema, error: %v", err)
	}
	Schema = s
}


================================================
FILE: examples/crud/Readme.md
================================================
# Go GraphQL CRUD example

Implement create, read, update and delete on Go.

To run the program:

1. go to the directory: `cd examples/crud`
2. Run the example: `go run main.go`

## Create

`http://localhost:8080/product?query=mutation+_{create(name:"Inca Kola",info:"Inca Kola is a soft drink that was created in Peru in 1935 by British immigrant Joseph Robinson Lindley using lemon verbena (wiki)",price:1.99){id,name,info,price}}`

## Read

* Get single product by id: `http://localhost:8080/product?query={product(id:1){name,info,price}}`
* Get product list: `http://localhost:8080/product?query={list{id,name,info,price}}`

## Update

`http://localhost:8080/product?query=mutation+_{update(id:1,price:3.95){id,name,info,price}}`

## Delete

`http://localhost:8080/product?query=mutation+_{delete(id:1){id,name,info,price}}`


================================================
FILE: examples/crud/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"math/rand"
	"net/http"
	"time"

	"github.com/graphql-go/graphql"
)

// Product contains information about one product
type Product struct {
	ID    int64   `json:"id"`
	Name  string  `json:"name"`
	Info  string  `json:"info,omitempty"`
	Price float64 `json:"price"`
}

var products = []Product{
	{
		ID:    1,
		Name:  "Chicha Morada",
		Info:  "Chicha morada is a beverage originated in the Andean regions of Perú but is actually consumed at a national level (wiki)",
		Price: 7.99,
	},
	{
		ID:    2,
		Name:  "Chicha de jora",
		Info:  "Chicha de jora is a corn beer chicha prepared by germinating maize, extracting the malt sugars, boiling the wort, and fermenting it in large vessels (traditionally huge earthenware vats) for several days (wiki)",
		Price: 5.95,
	},
	{
		ID:    3,
		Name:  "Pisco",
		Info:  "Pisco is a colorless or yellowish-to-amber colored brandy produced in winemaking regions of Peru and Chile (wiki)",
		Price: 9.95,
	},
}

var productType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "Product",
		Fields: graphql.Fields{
			"id": &graphql.Field{
				Type: graphql.Int,
			},
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"info": &graphql.Field{
				Type: graphql.String,
			},
			"price": &graphql.Field{
				Type: graphql.Float,
			},
		},
	},
)

var queryType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "Query",
		Fields: graphql.Fields{
			/* Get (read) single product by id
			   http://localhost:8080/product?query={product(id:1){name,info,price}}
			*/
			"product": &graphql.Field{
				Type:        productType,
				Description: "Get product by id",
				Args: graphql.FieldConfigArgument{
					"id": &graphql.ArgumentConfig{
						Type: graphql.Int,
					},
				},
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					id, ok := p.Args["id"].(int)
					if ok {
						// Find product
						for _, product := range products {
							if int(product.ID) == id {
								return product, nil
							}
						}
					}
					return nil, nil
				},
			},
			/* Get (read) product list
			   http://localhost:8080/product?query={list{id,name,info,price}}
			*/
			"list": &graphql.Field{
				Type:        graphql.NewList(productType),
				Description: "Get product list",
				Resolve: func(params graphql.ResolveParams) (interface{}, error) {
					return products, nil
				},
			},
		},
	})

var mutationType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Mutation",
	Fields: graphql.Fields{
		/* Create new product item
		http://localhost:8080/product?query=mutation+_{create(name:"Inca Kola",info:"Inca Kola is a soft drink that was created in Peru in 1935 by British immigrant Joseph Robinson Lindley using lemon verbena (wiki)",price:1.99){id,name,info,price}}
		*/
		"create": &graphql.Field{
			Type:        productType,
			Description: "Create new product",
			Args: graphql.FieldConfigArgument{
				"name": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.String),
				},
				"info": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
				"price": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.Float),
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {
				rand.Seed(time.Now().UnixNano())
				product := Product{
					ID:    int64(rand.Intn(100000)), // generate random ID
					Name:  params.Args["name"].(string),
					Info:  params.Args["info"].(string),
					Price: params.Args["price"].(float64),
				}
				products = append(products, product)
				return product, nil
			},
		},

		/* Update product by id
		   http://localhost:8080/product?query=mutation+_{update(id:1,price:3.95){id,name,info,price}}
		*/
		"update": &graphql.Field{
			Type:        productType,
			Description: "Update product by id",
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.Int),
				},
				"name": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
				"info": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
				"price": &graphql.ArgumentConfig{
					Type: graphql.Float,
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {
				id, _ := params.Args["id"].(int)
				name, nameOk := params.Args["name"].(string)
				info, infoOk := params.Args["info"].(string)
				price, priceOk := params.Args["price"].(float64)
				product := Product{}
				for i, p := range products {
					if int64(id) == p.ID {
						if nameOk {
							products[i].Name = name
						}
						if infoOk {
							products[i].Info = info
						}
						if priceOk {
							products[i].Price = price
						}
						product = products[i]
						break
					}
				}
				return product, nil
			},
		},

		/* Delete product by id
		   http://localhost:8080/product?query=mutation+_{delete(id:1){id,name,info,price}}
		*/
		"delete": &graphql.Field{
			Type:        productType,
			Description: "Delete product by id",
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.Int),
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {
				id, _ := params.Args["id"].(int)
				product := Product{}
				for i, p := range products {
					if int64(id) == p.ID {
						product = products[i]
						// Remove from product list
						products = append(products[:i], products[i+1:]...)
					}
				}

				return product, nil
			},
		},
	},
})

var schema, _ = graphql.NewSchema(
	graphql.SchemaConfig{
		Query:    queryType,
		Mutation: mutationType,
	},
)

func executeQuery(query string, schema graphql.Schema) *graphql.Result {
	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) > 0 {
		fmt.Printf("errors: %v", result.Errors)
	}
	return result
}

func main() {
	http.HandleFunc("/product", func(w http.ResponseWriter, r *http.Request) {
		result := executeQuery(r.URL.Query().Get("query"), schema)
		json.NewEncoder(w).Encode(result)
	})

	fmt.Println("Server is running on port 8080")
	http.ListenAndServe(":8080", nil)
}


================================================
FILE: examples/custom-scalar-type/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/language/ast"
)

type CustomID struct {
	value string
}

func (id *CustomID) String() string {
	return id.value
}

func NewCustomID(v string) *CustomID {
	return &CustomID{value: v}
}

var CustomScalarType = graphql.NewScalar(graphql.ScalarConfig{
	Name:        "CustomScalarType",
	Description: "The `CustomScalarType` scalar type represents an ID Object.",
	// Serialize serializes `CustomID` to string.
	Serialize: func(value interface{}) interface{} {
		switch value := value.(type) {
		case CustomID:
			return value.String()
		case *CustomID:
			v := *value
			return v.String()
		default:
			return nil
		}
	},
	// ParseValue parses GraphQL variables from `string` to `CustomID`.
	ParseValue: func(value interface{}) interface{} {
		switch value := value.(type) {
		case string:
			return NewCustomID(value)
		case *string:
			return NewCustomID(*value)
		default:
			return nil
		}
	},
	// ParseLiteral parses GraphQL AST value to `CustomID`.
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return NewCustomID(valueAST.Value)
		default:
			return nil
		}
	},
})

type Customer struct {
	ID *CustomID `json:"id"`
}

var CustomerType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Customer",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: CustomScalarType,
		},
	},
})

func main() {
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"customers": &graphql.Field{
					Type: graphql.NewList(CustomerType),
					Args: graphql.FieldConfigArgument{
						"id": &graphql.ArgumentConfig{
							Type: CustomScalarType,
						},
					},
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						// id := p.Args["id"]
						// log.Printf("id from arguments: %+v", id)
						customers := []Customer{
							Customer{ID: NewCustomID("fb278f2a4a13f")},
						}
						return customers, nil
					},
				},
			},
		}),
	})
	if err != nil {
		log.Fatal(err)
	}
	query := `
		query {
			customers {
				id
			}
		}
	`
	/*
		queryWithVariable := `
			query($id: CustomScalarType) {
				customers(id: $id) {
					id
				}
			}
		`
	*/
	/*
		queryWithArgument := `
			query {
				customers(id: "5b42ba57289") {
					id
				}
			}
		`
	*/
	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
		VariableValues: map[string]interface{}{
			"id": "5b42ba57289",
		},
	})
	if len(result.Errors) > 0 {
		log.Fatal(result)
	}
	b, err := json.Marshal(result)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(b))
}


================================================
FILE: examples/hello-world/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
)

func main() {
	// Schema
	fields := graphql.Fields{
		"hello": &graphql.Field{
			Type: graphql.String,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				return "world", nil
			},
		},
	}
	rootQuery := graphql.ObjectConfig{Name: "RootQuery", Fields: fields}
	schemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)}
	schema, err := graphql.NewSchema(schemaConfig)
	if err != nil {
		log.Fatalf("failed to create new schema, error: %v", err)
	}

	// Query
	query := `
		{
			hello
		}
	`
	params := graphql.Params{Schema: schema, RequestString: query}
	r := graphql.Do(params)
	if len(r.Errors) > 0 {
		log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors)
	}
	rJSON, _ := json.Marshal(r)
	fmt.Printf("%s \n", rJSON) // {“data”:{“hello”:”world”}}
}


================================================
FILE: examples/http/data.json
================================================
{
  "1": {
    "id": "1",
    "name": "Dan"
  },
  "2": {
    "id": "2",
    "name": "Lee"
  },
  "3": {
    "id": "3",
    "name": "Nick"
  }
}

================================================
FILE: examples/http/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"

	"github.com/graphql-go/graphql"
)

type user struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

var data map[string]user

/*
   Create User object type with fields "id" and "name" by using GraphQLObjectTypeConfig:
       - Name: name of object type
       - Fields: a map of fields by using GraphQLFields
   Setup type of field use GraphQLFieldConfig
*/
var userType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "User",
		Fields: graphql.Fields{
			"id": &graphql.Field{
				Type: graphql.String,
			},
			"name": &graphql.Field{
				Type: graphql.String,
			},
		},
	},
)

/*
   Create Query object type with fields "user" has type [userType] by using GraphQLObjectTypeConfig:
       - Name: name of object type
       - Fields: a map of fields by using GraphQLFields
   Setup type of field use GraphQLFieldConfig to define:
       - Type: type of field
       - Args: arguments to query with current field
       - Resolve: function to query data using params from [Args] and return value with current type
*/
var queryType = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "Query",
		Fields: graphql.Fields{
			"user": &graphql.Field{
				Type: userType,
				Args: graphql.FieldConfigArgument{
					"id": &graphql.ArgumentConfig{
						Type: graphql.String,
					},
				},
				Resolve: func(p graphql.ResolveParams) (interface{}, error) {
					idQuery, isOK := p.Args["id"].(string)
					if isOK {
						return data[idQuery], nil
					}
					return nil, nil
				},
			},
		},
	})

var schema, _ = graphql.NewSchema(
	graphql.SchemaConfig{
		Query: queryType,
	},
)

func executeQuery(query string, schema graphql.Schema) *graphql.Result {
	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) > 0 {
		fmt.Printf("wrong result, unexpected errors: %v", result.Errors)
	}
	return result
}

func main() {
	_ = importJSONDataFromFile("data.json", &data)

	http.HandleFunc("/graphql", func(w http.ResponseWriter, r *http.Request) {
		result := executeQuery(r.URL.Query().Get("query"), schema)
		json.NewEncoder(w).Encode(result)
	})

	fmt.Println("Now server is running on port 8080")
	fmt.Println("Test with Get      : curl -g 'http://localhost:8080/graphql?query={user(id:\"1\"){name}}'")
	http.ListenAndServe(":8080", nil)
}

//Helper function to import json from file to map
func importJSONDataFromFile(fileName string, result interface{}) (isOK bool) {
	isOK = true
	content, err := ioutil.ReadFile(fileName)
	if err != nil {
		fmt.Print("Error:", err)
		isOK = false
	}
	err = json.Unmarshal(content, result)
	if err != nil {
		isOK = false
		fmt.Print("Error:", err)
	}
	return
}


================================================
FILE: examples/http-post/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"net/http"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/examples/todo/schema"
)

type postData struct {
	Query     string                 `json:"query"`
	Operation string                 `json:"operationName"`
	Variables map[string]interface{} `json:"variables"`
}

func main() {
	http.HandleFunc("/graphql", func(w http.ResponseWriter, req *http.Request) {
		var p postData
		if err := json.NewDecoder(req.Body).Decode(&p); err != nil {
			w.WriteHeader(400)
			return
		}
		result := graphql.Do(graphql.Params{
			Context:        req.Context(),
			Schema:         schema.TodoSchema,
			RequestString:  p.Query,
			VariableValues: p.Variables,
			OperationName:  p.Operation,
		})
		if err := json.NewEncoder(w).Encode(result); err != nil {
			fmt.Printf("could not write result to response: %s", err)
		}
	})

	fmt.Println("Now server is running on port 8080")

	fmt.Println("")

	fmt.Println(`Get single todo:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ todo(id:\"b\") { id text done } }" }' \
http://localhost:8080/graphql`)

	fmt.Println("")

	fmt.Println(`Create new todo:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "mutation { createTodo(text:\"My New todo\") { id text done } }" }' \
http://localhost:8080/graphql`)

	fmt.Println("")

	fmt.Println(`Update todo:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "mutation { updateTodo(id:\"a\", done: true) { id text done } }" }' \
http://localhost:8080/graphql`)

	fmt.Println("")

	fmt.Println(`Load todo list:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ todoList { id text done } }" }' \
http://localhost:8080/graphql`)

	http.ListenAndServe(":8080", nil)
}


================================================
FILE: examples/httpdynamic/README.md
================================================
Basically, if we have `data.json` like this:

    [
      { "id": "1", "name": "Dan" },
      { "id": "2", "name": "Lee" },
      { "id": "3", "name": "Nick" }
    ]

... and `go run main.go`, we can query records:

	$ curl -g 'http://localhost:8080/graphql?query={user(name:"Dan"){id}}'
	{"data":{"user":{"id":"1"}}}

... now let's give Dan a surname:

    [
      { "id": "1", "name": "Dan", "surname": "Jones" },
      { "id": "2", "name": "Lee" },
      { "id": "3", "name": "Nick" }
    ]

... and kick the server:

    kill -SIGUSR1 52114

And ask for Dan's surname:

	$ curl -g 'http://localhost:8080/graphql?query={user(name:"Dan"){id,surname}}'
	{"data":{"user":{"id":"1","surname":"Jones"}}}

... or ask Jones's name and ID:

    $ curl -g 'http://localhost:8080/graphql?query={user(surname:"Jones"){id,name}}'
    {"data":{"user":{"id":"1","name":"Dan"}}}

If you look at `main.go`, the file is not field-aware. That is, all it knows is
how to work with `[]map[string]string` type.

With this, we are not that far from exposing dynamic fields and filters which
fully depend on what we have stored, all without changing our tooling.


================================================
FILE: examples/httpdynamic/data.json
================================================
[
  {
    "id": "1",
    "name": "Dan",
    "surname": "Jones"
  },
  {
    "id": "2",
    "name": "Lee"
  },
  {
    "id": "3",
    "name": "Nick"
  }
]


================================================
FILE: examples/httpdynamic/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"os/signal"
	"strconv"
	"syscall"

	"github.com/graphql-go/graphql"
)

/*****************************************************************************/
/* Shared data variables to allow dynamic reloads
/*****************************************************************************/

var schema graphql.Schema

const jsonDataFile = "data.json"

func handleSIGUSR1(c chan os.Signal) {
	for {
		<-c
		fmt.Printf("Caught SIGUSR1. Reloading %s\n", jsonDataFile)
		err := importJSONDataFromFile(jsonDataFile)
		if err != nil {
			fmt.Printf("Error: %s\n", err.Error())
			return
		}
	}
}

func filterUser(data []map[string]interface{}, args map[string]interface{}) map[string]interface{} {
	for _, user := range data {
		for k, v := range args {
			if user[k] != v {
				goto nextuser
			}
			return user
		}

	nextuser:
	}
	return nil
}

func executeQuery(query string, schema graphql.Schema) *graphql.Result {
	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) > 0 {
		fmt.Printf("wrong result, unexpected errors: %v\n", result.Errors)
	}
	return result
}

func importJSONDataFromFile(fileName string) error {
	content, err := ioutil.ReadFile(fileName)
	if err != nil {
		return err
	}

	var data []map[string]interface{}

	err = json.Unmarshal(content, &data)
	if err != nil {
		return err
	}

	fields := make(graphql.Fields)
	args := make(graphql.FieldConfigArgument)
	for _, item := range data {
		for k := range item {
			fields[k] = &graphql.Field{
				Type: graphql.String,
			}
			args[k] = &graphql.ArgumentConfig{
				Type: graphql.String,
			}
		}
	}

	var userType = graphql.NewObject(
		graphql.ObjectConfig{
			Name:   "User",
			Fields: fields,
		},
	)

	var queryType = graphql.NewObject(
		graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"user": &graphql.Field{
					Type: userType,
					Args: args,
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						return filterUser(data, p.Args), nil
					},
				},
			},
		})

	schema, _ = graphql.NewSchema(
		graphql.SchemaConfig{
			Query: queryType,
		},
	)

	return nil
}

func main() {
	// Catch SIGUSR1 and reload the data file
	c := make(chan os.Signal, 1)
	signal.Notify(c, syscall.SIGUSR1)
	go handleSIGUSR1(c)

	err := importJSONDataFromFile(jsonDataFile)
	if err != nil {
		fmt.Printf("Error: %s\n", err.Error())
		return
	}

	http.HandleFunc("/graphql", func(w http.ResponseWriter, r *http.Request) {
		result := executeQuery(r.URL.Query().Get("query"), schema)
		json.NewEncoder(w).Encode(result)
	})

	fmt.Println("Now server is running on port 8080")
	fmt.Println("Test with Get      : curl -g 'http://localhost:8080/graphql?query={user(name:\"Dan\"){id,surname}}'")
	fmt.Printf("Reload json file   : kill -SIGUSR1 %s\n", strconv.Itoa(os.Getpid()))
	http.ListenAndServe(":8080", nil)
}


================================================
FILE: examples/modify-context/main.go
================================================
package main

import (
	"context"
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
)

type User struct {
	ID int `json:"id"`
}

var UserType = graphql.NewObject(graphql.ObjectConfig{
	Name: "User",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.Int,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				rootValue := p.Info.RootValue.(map[string]interface{})
				if rootValue["data-from-parent"] == "ok" &&
					rootValue["data-before-execution"] == "ok" {
					user := p.Source.(User)
					return user.ID, nil
				}
				return nil, nil
			},
		},
	},
})

func main() {
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"users": &graphql.Field{
					Type: graphql.NewList(UserType),
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						rootValue := p.Info.RootValue.(map[string]interface{})
						rootValue["data-from-parent"] = "ok"
						result := []User{
							User{ID: 1},
						}
						return result, nil

					},
				},
			},
		}),
	})
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.WithValue(context.Background(), "currentUser", User{ID: 100})
	// Instead of trying to modify context within a resolve function, use:
	// `graphql.Params.RootObject` is a mutable optional variable and available on
	// each resolve function via: `graphql.ResolveParams.Info.RootValue`.
	rootObject := map[string]interface{}{
		"data-before-execution": "ok",
	}
	result := graphql.Do(graphql.Params{
		Context:       ctx,
		RequestString: "{ users { id } }",
		RootObject:    rootObject,
		Schema:        schema,
	})
	b, err := json.Marshal(result)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s\n", string(b)) // {"data":{"users":[{"id":1}]}}
}


================================================
FILE: examples/sql-nullstring/README.md
================================================
# Go GraphQL SQL null string example

<a target="_blank" rel="noopener noreferrer" href="https://golang.org/pkg/database/sql/#NullString">database/sql Nullstring</a> implementation, with JSON marshalling interfaces.

To run the program, go to the directory  
`cd examples/sql-nullstring`

Run the example  
`go run main.go`

## sql.NullString

On occasion you will encounter sql fields that are nullable, as in

```sql
CREATE TABLE persons (
    id INT PRIMARY KEY,
    name TEXT NOT NULL,
    favorite_dog TEXT -- this field can have a NULL value
)
```

For the struct

```golang
import "database/sql"

type Person struct {
    ID          int             `json:"id" sql:"id"`
    Name        string          `json:"name" sql:"name"`
    FavoriteDog sql.NullString  `json:"favorite_dog" sql:"favorite_dog"`
}
```

But `graphql` would render said field as an object `{{ false}}` or `{{Bulldog true}}`, depending on their validity.

With this implementation, `graphql` would render the null items as an empty string (`""`), but would be saved in the database as `NULL`, appropriately.

The pattern can be extended to include other `database/sql` null types.


================================================
FILE: examples/sql-nullstring/main.go
================================================
package main

import (
	"database/sql"
	"encoding/json"
	"fmt"
	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/language/ast"
	"log"
)

// NullString to be used in place of sql.NullString
type NullString struct {
	sql.NullString
}

// MarshalJSON from the json.Marshaler interface
func (v NullString) MarshalJSON() ([]byte, error) {
	if v.Valid {
		return json.Marshal(v.String)
	}
	return json.Marshal(nil)
}

// UnmarshalJSON from the json.Unmarshaler interface
func (v *NullString) UnmarshalJSON(data []byte) error {
	var x *string
	if err := json.Unmarshal(data, &x); err != nil {
		return err
	}
	if x != nil {
		v.String = *x
		v.Valid = true
	} else {
		v.Valid = false
	}
	return nil
}

// NewNullString create a new null string. Empty string evaluates to an
// "invalid" NullString
func NewNullString(value string) *NullString {
	var null NullString
	if value != "" {
		null.String = value
		null.Valid = true
		return &null
	}
	null.Valid = false
	return &null
}

// SerializeNullString serializes `NullString` to a string
func SerializeNullString(value interface{}) interface{} {
	switch value := value.(type) {
	case NullString:
		return value.String
	case *NullString:
		v := *value
		return v.String
	default:
		return nil
	}
}

// ParseNullString parses GraphQL variables from `string` to `CustomID`
func ParseNullString(value interface{}) interface{} {
	switch value := value.(type) {
	case string:
		return NewNullString(value)
	case *string:
		return NewNullString(*value)
	default:
		return nil
	}
}

// ParseLiteralNullString parses GraphQL AST value to `NullString`.
func ParseLiteralNullString(valueAST ast.Value) interface{} {
	switch valueAST := valueAST.(type) {
	case *ast.StringValue:
		return NewNullString(valueAST.Value)
	default:
		return nil
	}
}

// NullableString graphql *Scalar type based of NullString
var NullableString = graphql.NewScalar(graphql.ScalarConfig{
	Name:         "NullableString",
	Description:  "The `NullableString` type repesents a nullable SQL string.",
	Serialize:    SerializeNullString,
	ParseValue:   ParseNullString,
	ParseLiteral: ParseLiteralNullString,
})

/*
CREATE TABLE persons (
	favorite_dog TEXT -- is a nullable field
	);

*/

// Person noqa
type Person struct {
	Name        string      `json:"name"`
	FavoriteDog *NullString `json:"favorite_dog"` // Some people don't like dogs ¯\_(ツ)_/¯
}

// PersonType noqa
var PersonType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Person",
	Fields: graphql.Fields{
		"name": &graphql.Field{
			Type: graphql.String,
		},
		"favorite_dog": &graphql.Field{
			Type: NullableString,
		},
	},
})

func main() {
	schema, err := graphql.NewSchema(graphql.SchemaConfig{
		Query: graphql.NewObject(graphql.ObjectConfig{
			Name: "Query",
			Fields: graphql.Fields{
				"people": &graphql.Field{
					Type: graphql.NewList(PersonType),
					Args: graphql.FieldConfigArgument{
						"favorite_dog": &graphql.ArgumentConfig{
							Type: NullableString,
						},
					},
					Resolve: func(p graphql.ResolveParams) (interface{}, error) {
						dog, dogOk := p.Args["favorite_dog"].(*NullString)
						people := []Person{
							Person{Name: "Alice", FavoriteDog: NewNullString("Yorkshire Terrier")},
							// `Bob`'s favorite dog will be saved as null in the database
							Person{Name: "Bob", FavoriteDog: NewNullString("")},
							Person{Name: "Chris", FavoriteDog: NewNullString("French Bulldog")},
						}
						switch {
						case dogOk:
							log.Printf("favorite_dog from arguments: %+v", dog)
							dogPeople := make([]Person, 0)
							for _, p := range people {
								if p.FavoriteDog.Valid {
									if p.FavoriteDog.String == dog.String {
										dogPeople = append(dogPeople, p)
									}
								}
							}
							return dogPeople, nil
						default:
							return people, nil
						}
					},
				},
			},
		}),
	})
	if err != nil {
		log.Fatal(err)
	}
	query := `
query {
  people {
    name
    favorite_dog
    }
}`
	queryWithArgument := `
query {
  people(favorite_dog: "Yorkshire Terrier") {
    name
    favorite_dog
  }
}`
	r1 := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	r2 := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: queryWithArgument,
	})
	if len(r1.Errors) > 0 {
		log.Fatal(r1)
	}
	if len(r2.Errors) > 0 {
		log.Fatal(r1)
	}
	b1, err := json.MarshalIndent(r1, "", "  ")
	if err != nil {
		log.Fatal(err)
	}
	b2, err := json.MarshalIndent(r2, "", "  ")
	if err != nil {
		log.Fatal(err)

	}
	fmt.Printf("\nQuery: %+v\n", string(query))
	fmt.Printf("\nResult: %+v\n", string(b1))
	fmt.Printf("\nQuery (with arguments): %+v\n", string(queryWithArgument))
	fmt.Printf("\nResult (with arguments): %+v\n", string(b2))
}

/* Output:
Query:
query {
  people {
    name
    favorite_dog
    }
}

Result: {
  "data": {
    "people": [
      {
        "favorite_dog": "Yorkshire Terrier",
        "name": "Alice"
      },
      {
        "favorite_dog": "",
        "name": "Bob"
      },
      {
        "favorite_dog": "French Bulldog",
        "name": "Chris"
      }
    ]
  }
}

Query (with arguments):
query {
  people(favorite_dog: "Yorkshire Terrier") {
    name
    favorite_dog
  }
}

Result (with arguments): {
  "data": {
    "people": [
      {
        "favorite_dog": "Yorkshire Terrier",
        "name": "Alice"
      }
    ]
  }
}
*/


================================================
FILE: examples/star-wars/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"net/http"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/testutil"
)

func main() {
	http.HandleFunc("/graphql", func(w http.ResponseWriter, r *http.Request) {
		query := r.URL.Query().Get("query")
		result := graphql.Do(graphql.Params{
			Schema:        testutil.StarWarsSchema,
			RequestString: query,
		})
		json.NewEncoder(w).Encode(result)
	})
	fmt.Println("Now server is running on port 8080")
	fmt.Println("Test with Get      : curl -g 'http://localhost:8080/graphql?query={hero{name}}'")
	http.ListenAndServe(":8080", nil)
}


================================================
FILE: examples/todo/README.md
================================================
# Go GraphQL ToDo example

An example that consists of basic core GraphQL queries and mutations.

To run the example navigate to the example directory by using your shell of choice.

```
cd examples/todo
```

Run the example, it will spawn a GraphQL HTTP endpoint

```
go run main.go
```

Execute queries via shell.

```
// To get single ToDo item by ID
curl -g 'http://localhost:8080/graphql?query={todo(id:"b"){id,text,done}}'

// To create a ToDo item
curl -g 'http://localhost:8080/graphql?query=mutation+_{createTodo(text:"My+new+todo"){id,text,done}}'

// To get a list of ToDo items
curl -g 'http://localhost:8080/graphql?query={todoList{id,text,done}}'

// To update a ToDo
curl -g 'http://localhost:8080/graphql?query=mutation+_{updateTodo(id:"b",text:"My+new+todo+updated",done:true){id,text,done}}'
```

## Web App

Access the web app at `http://localhost:8080/`. It is work in progress and currently is simply loading todos by using jQuery ajax call.


================================================
FILE: examples/todo/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"math/rand"
	"net/http"
	"time"

	"github.com/graphql-go/graphql"
	"github.com/graphql-go/graphql/examples/todo/schema"
)

func init() {
	todo1 := schema.Todo{ID: "a", Text: "A todo not to forget", Done: false}
	todo2 := schema.Todo{ID: "b", Text: "This is the most important", Done: false}
	todo3 := schema.Todo{ID: "c", Text: "Please do this or else", Done: false}
	schema.TodoList = append(schema.TodoList, todo1, todo2, todo3)

	rand.Seed(time.Now().UnixNano())
}

func executeQuery(query string, schema graphql.Schema) *graphql.Result {
	result := graphql.Do(graphql.Params{
		Schema:        schema,
		RequestString: query,
	})
	if len(result.Errors) > 0 {
		fmt.Printf("wrong result, unexpected errors: %v", result.Errors)
	}
	return result
}

func main() {
	http.HandleFunc("/graphql", func(w http.ResponseWriter, r *http.Request) {
		result := executeQuery(r.URL.Query().Get("query"), schema.TodoSchema)
		json.NewEncoder(w).Encode(result)
	})
	// Serve static files
	fs := http.FileServer(http.Dir("static"))
	http.Handle("/", fs)
	// Display some basic instructions
	fmt.Println("Now server is running on port 8080")
	fmt.Println("Get single todo: curl -g 'http://localhost:8080/graphql?query={todo(id:\"b\"){id,text,done}}'")
	fmt.Println("Create new todo: curl -g 'http://localhost:8080/graphql?query=mutation+_{createTodo(text:\"My+new+todo\"){id,text,done}}'")
	fmt.Println("Update todo: curl -g 'http://localhost:8080/graphql?query=mutation+_{updateTodo(id:\"a\",done:true){id,text,done}}'")
	fmt.Println("Load todo list: curl -g 'http://localhost:8080/graphql?query={todoList{id,text,done}}'")
	fmt.Println("Access the web app via browser at 'http://localhost:8080'")

	http.ListenAndServe(":8080", nil)
}


================================================
FILE: examples/todo/schema/schema.go
================================================
package schema

import (
	"math/rand"

	"github.com/graphql-go/graphql"
)

var TodoList []Todo

type Todo struct {
	ID   string `json:"id"`
	Text string `json:"text"`
	Done bool   `json:"done"`
}

var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

func RandStringRunes(n int) string {
	b := make([]rune, n)
	for i := range b {
		b[i] = letterRunes[rand.Intn(len(letterRunes))]
	}
	return string(b)
}

// define custom GraphQL ObjectType `todoType` for our Golang struct `Todo`
// Note that
// - the fields in our todoType maps with the json tags for the fields in our struct
// - the field type matches the field type in our struct
var todoType = graphql.NewObject(graphql.ObjectConfig{
	Name: "Todo",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.String,
		},
		"text": &graphql.Field{
			Type: graphql.String,
		},
		"done": &graphql.Field{
			Type: graphql.Boolean,
		},
	},
})

// root mutation
var rootMutation = graphql.NewObject(graphql.ObjectConfig{
	Name: "RootMutation",
	Fields: graphql.Fields{
		/*
			curl -g 'http://localhost:8080/graphql?query=mutation+_{createTodo(text:"My+new+todo"){id,text,done}}'
		*/
		"createTodo": &graphql.Field{
			Type:        todoType, // the return type for this field
			Description: "Create new todo",
			Args: graphql.FieldConfigArgument{
				"text": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.String),
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {

				// marshall and cast the argument value
				text, _ := params.Args["text"].(string)

				// figure out new id
				newID := RandStringRunes(8)

				// perform mutation operation here
				// for e.g. create a Todo and save to DB.
				newTodo := Todo{
					ID:   newID,
					Text: text,
					Done: false,
				}

				TodoList = append(TodoList, newTodo)

				// return the new Todo object that we supposedly save to DB
				// Note here that
				// - we are returning a `Todo` struct instance here
				// - we previously specified the return Type to be `todoType`
				// - `Todo` struct maps to `todoType`, as defined in `todoType` ObjectConfig`
				return newTodo, nil
			},
		},
		/*
			curl -g 'http://localhost:8080/graphql?query=mutation+_{updateTodo(id:"a",done:true){id,text,done}}'
		*/
		"updateTodo": &graphql.Field{
			Type:        todoType, // the return type for this field
			Description: "Update existing todo, mark it done or not done",
			Args: graphql.FieldConfigArgument{
				"done": &graphql.ArgumentConfig{
					Type: graphql.Boolean,
				},
				"id": &graphql.ArgumentConfig{
					Type: graphql.NewNonNull(graphql.String),
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {
				// marshall and cast the argument value
				done, _ := params.Args["done"].(bool)
				id, _ := params.Args["id"].(string)
				affectedTodo := Todo{}

				// Search list for todo with id and change the done variable
				for i := 0; i < len(TodoList); i++ {
					if TodoList[i].ID == id {
						TodoList[i].Done = done
						// Assign updated todo so we can return it
						affectedTodo = TodoList[i]
						break
					}
				}
				// Return affected todo
				return affectedTodo, nil
			},
		},
	},
})

// root query
// we just define a trivial example here, since root query is required.
// Test with curl
// curl -g 'http://localhost:8080/graphql?query={lastTodo{id,text,done}}'
var rootQuery = graphql.NewObject(graphql.ObjectConfig{
	Name: "RootQuery",
	Fields: graphql.Fields{

		/*
		   curl -g 'http://localhost:8080/graphql?query={todo(id:"b"){id,text,done}}'
		*/
		"todo": &graphql.Field{
			Type:        todoType,
			Description: "Get single todo",
			Args: graphql.FieldConfigArgument{
				"id": &graphql.ArgumentConfig{
					Type: graphql.String,
				},
			},
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {

				idQuery, isOK := params.Args["id"].(string)
				if isOK {
					// Search for el with id
					for _, todo := range TodoList {
						if todo.ID == idQuery {
							return todo, nil
						}
					}
				}

				return Todo{}, nil
			},
		},

		"lastTodo": &graphql.Field{
			Type:        todoType,
			Description: "Last todo added",
			Resolve: func(params graphql.ResolveParams) (interface{}, error) {
				return TodoList[len(TodoList)-1], nil
			},
		},

		/*
		   curl -g 'http://localhost:8080/graphql?query={todoList{id,text,done}}'
		*/
		"todoList": &graphql.Field{
			Type:        graphql.NewList(todoType),
			Description: "List of todos",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				return TodoList, nil
			},
		},
	},
})

// define schema, with our rootQuery and rootMutation
var TodoSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
	Query:    rootQuery,
	Mutation: rootMutation,
})


================================================
FILE: examples/todo/static/assets/css/style.css
================================================
body {
    background-color: #cccccc;
    color: #333333;
    font-family: sans-serif;
}

.todo-done {
    opacity: 0.5;
}

================================================
FILE: examples/todo/static/assets/js/app.js
================================================
var updateTodo = function(id, isDone){
  $.ajax({
    url: '/graphql?query=mutation+_{updateTodo(id:"' + id + '",done:' + isDone + '){id,text,done}}'
  }).done(function(data) {
    console.log(data);
    var dataParsed = JSON.parse(data);
    var updatedTodo = dataParsed.data.updateTodo;
    if (updatedTodo.done) {
      $('#' + updatedTodo.id).parent().parent().parent().addClass('todo-done');
    } else {
      $('#' + updatedTodo.id).parent().parent().parent().removeClass('todo-done');
    } 
  });
};

var handleTodoList = function(object) {
  var todos = object;

  if (!todos.length) {
    $('.todo-list-container').append('<p>There are no tasks for you today</p>');
    return
  } else {
    $('.todo-list-container p').remove();
  }

  $.each(todos, function(i, v) {
    var todoTemplate = $('#todoItemTemplate').html();
    var todo = todoTemplate.replace('{{todo-id}}', v.id);
    todo = todo.replace('{{todo-text}}', v.text);
    todo = todo.replace('{{todo-checked}}', (v.done ? ' checked="checked"' : ''));
    todo = todo.replace('{{todo-done}}', (v.done ? ' todo-done' : ''));

    $('.todo-list-container').append(todo);
    $('#' + v.id).click(function(){
      var id = $(this).prop('id');
      var isDone = $(this).prop('checked');
      updateTodo(id, isDone);
    });
  });
};

var loadTodos = function() {
  $.ajax({
    url: "/graphql?query={todoList{id,text,done}}"
  }).done(function(data) {
    console.log(data);
    var dataParsed = JSON.parse(data);
    handleTodoList(dataParsed.data.todoList);
  });
};

var addTodo = function(todoText) {
  if (!todoText || todoText === "") {
    alert('Please specify a task');
    return;
  }

  $.ajax({
    url: '/graphql?query=mutation+_{createTodo(text:"' + todoText + '"){id,text,done}}'
  }).done(function(data) {
    console.log(data);
    var dataParsed = JSON.parse(data);
    var todoList = [dataParsed.data.createTodo];
    handleTodoList(todoList);
  });
};

$(document).ready(function() {
  $('.todo-add-form').submit(function(e){
    e.preventDefault();
    addTodo($('.todo-add-form #task').val());
    $('.todo-add-form #task').val('');
  });

  loadTodos();
});


================================================
FILE: examples/todo/static/index.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>ToDo</title>
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" media="all" href="/assets/css/style.css">
</head>
<body>

<div class="wrapper">

  <div class="container">

    <h1>ToDo</h1>

    <div class="todo-list">
      <h2>Tasks</h2>
      <div class="todo-list-container">
        
        <div class=""></div>

      </div>
    </div><!-- /.todo-list -->

    <div class="todo-add">
      
      <h2>Add task</h2>

      <form class="todo-add-form">
        <div class="form-group">
          <input 
            type="text" 
            name="task" 
            id="task" 
            placeholder="Your task"
            class="form-control">
        </div>
        <button class="btn btn-primary">Add</button>
      </form>

    </div><!-- /.todo-add -->

  </div><!-- /.container -->

</div><!-- /.wrapper -->

<template id="todoItemTemplate">
  <div class="todo-item{{todo-done}}">
    <div class="checkbox">
      <label>
        <input id="{{todo-id}}" type="checkbox"{{todo-checked}}> {{todo-text}}
      </label>
    </div>
  </div>
</template>

<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="/assets/js/app.js"></script>

</body>
</html>

================================================
FILE: executor.go
================================================
package graphql

import (
	"context"
	"errors"
	"fmt"
	"reflect"
	"sort"
	"strings"

	"github.com/graphql-go/graphql/gqlerrors"
	"github.com/graphql-go/graphql/language/ast"
)

type ExecuteParams struct {
	Schema        Schema
	Root          interface{}
	AST           *ast.Document
	OperationName string
	Args          map[string]interface{}

	// Context may be provided to pass application-specific per-request
	// information to resolve functions.
	Context context.Context
}

func Execute(p ExecuteParams) (result *Result) {
	// Use background context if no context was provided
	ctx := p.Context
	if ctx == nil {
		ctx = context.Background()
	}
	// run executionDidStart functions from extensions
	extErrs, executionFinishFn := handleExtensionsExecutionDidStart(&p)
	if len(extErrs) != 0 {
		return &Result{
			Errors: extErrs,
		}
	}

	defer func() {
		extErrs = executionFinishFn(result)
		if len(extErrs) != 0 {
			result.Errors = append(result.Errors, extErrs...)
		}

		addExtensionResults(&p, result)
	}()

	resultChannel := make(chan *Result, 2)

	go func() {
		result := &Result{}

		defer func() {
			if err := recover(); err != nil {
				result.Errors = append(result.Errors, gqlerrors.FormatError(err.(error)))
			}
			resultChannel <- result
		}()

		exeContext, err := buildExecutionContext(buildExecutionCtxParams{
			Schema:        p.Schema,
			Root:          p.Root,
			AST:           p.AST,
			OperationName: p.OperationName,
			Args:          p.Args,
			Result:        result,
			Context:       p.Context,
		})

		if err != nil {
			result.Errors = append(result.Errors, gqlerrors.FormatError(err.(error)))
			resultChannel <- result
			return
		}

		resultChannel <- executeOperation(executeOperationParams{
			ExecutionContext: exeContext,
			Root:             p.Root,
			Operation:        exeContext.Operation,
		})
	}()

	select {
	case <-ctx.Done():
		result := &Result{}
		result.Errors = append(result.Errors, gqlerrors.FormatError(ctx.Err()))
		return result
	case r := <-resultChannel:
		return r
	}
}

type buildExecutionCtxParams struct {
	Schema        Schema
	Root          interface{}
	AST           *ast.Document
	OperationName string
	Args          map[string]interface{}
	Result        *Result
	Context       context.Context
}

type executionContext struct {
	Schema         Schema
	Fragments      map[string]ast.Definition
	Root           interface{}
	Operation      ast.Definition
	VariableValues map[string]interface{}
	Errors         []gqlerrors.FormattedError
	Context        context.Context
}

func buildExecutionContext(p buildExecutionCtxParams) (*executionContext, error) {
	eCtx := &executionContext{}
	var operation *ast.OperationDefinition
	fragments := map[string]ast.Definition{}

	for _, definition := range p.AST.Definitions {
		switch definition := definition.(type) {
		case *ast.OperationDefinition:
			if (p.OperationName == "") && operation != nil {
				return nil, errors.New("Must provide operation name if query contains multiple operations.")
			}
			if p.OperationName == "" || definition.GetName() != nil && definition.GetName().Value == p.OperationName {
				operation = definition
			}
		case *ast.FragmentDefinition:
			key := ""
			if definition.GetName() != nil && definition.GetName().Value != "" {
				key = definition.GetName().Value
			}
			fragments[key] = definition
		default:
			return nil, fmt.Errorf("GraphQL cannot execute a request containing a %v", definition.GetKind())
		}
	}

	if operation == nil {
		if p.OperationName != "" {
			return nil, fmt.Errorf(`Unknown operation named "%v".`, p.OperationName)
		}
		return nil, fmt.Errorf(`Must provide an operation.`)
	}

	variableValues, err := getVariableValues(p.Schema, operation.GetVariableDefinitions(), p.Args)
	if err != nil {
		return nil, err
	}

	eCtx.Schema = p.Schema
	eCtx.Fragments = fragments
	eCtx.Root = p.Root
	eCtx.Operation = operation
	eCtx.VariableValues = variableValues
	eCtx.Context = p.Context
	return eCtx, nil
}

type executeOperationParams struct {
	ExecutionContext *executionContext
	Root             interface{}
	Operation        ast.Definition
}

func executeOperation(p executeOperationParams) *Result {
	operationType, err := getOperationRootType(p.ExecutionContext.Schema, p.Operation)
	if err != nil {
		return &Result{Errors: gqlerrors.FormatErrors(err)}
	}

	fields := collectFields(collectFieldsParams{
		ExeContext:   p.ExecutionContext,
		RuntimeType:  operationType,
		SelectionSet: p.Operation.GetSelectionSet(),
	})

	executeFieldsParams := executeFieldsParams{
		ExecutionContext: p.ExecutionContext,
		ParentType:       operationType,
		Source:           p.Root,
		Fields:           fields,
	}

	if p.Operation.GetOperation() == ast.OperationTypeMutation {
		return executeFieldsSerially(executeFieldsParams)
	}
	return executeFields(executeFieldsParams)

}

// Extracts the root type of the operation from the schema.
func getOperationRootType(schema Schema, operation ast.Definition) (*Object, error) {
	if operation == nil {
		return nil, errors.New("Can only execute queries, mutations and subscription")
	}

	switch operation.GetOperation() {
	case ast.OperationTypeQuery:
		return schema.QueryType(), nil
	case ast.OperationTypeMutation:
		mutationType := schema.MutationType()
		if mutationType == nil || mutationType.PrivateName == "" {
			return nil, gqlerrors.NewError(
				"Schema is not configured for mutations",
				[]ast.Node{operation},
				"",
				nil,
				[]int{},
				nil,
			)
		}
		return mutationType, nil
	case ast.OperationTypeSubscription:
		subscriptionType := schema.SubscriptionType()
		if subscriptionType == nil || subscriptionType.PrivateName == "" {
			return nil, gqlerrors.NewError(
				"Schema is not configured for subscriptions",
				[]ast.Node{operation},
				"",
				nil,
				[]int{},
				nil,
			)
		}
		return subscriptionType, nil
	default:
		return nil, gqlerrors.NewError(
			"Can only execute queries, mutations and subscription",
			[]ast.Node{operation},
			"",
			nil,
			[]int{},
			nil,
		)
	}
}

type executeFieldsParams struct {
	ExecutionContext *executionContext
	ParentType       *Object
	Source           interface{}
	Fields           map[string][]*ast.Field
	Path             *ResponsePath
}

// Implements the "Evaluating selection sets" section of the spec for "write" mode.
func executeFieldsSerially(p executeFieldsParams) *Result {
	if p.Source == nil {
		p.Source = map[string]interface{}{}
	}
	if p.Fields == nil {
		p.Fields = map[string][]*ast.Field{}
	}

	finalResults := make(map[string]interface{}, len(p.Fields))
	for _, orderedField := range orderedFields(p.Fields) {
		responseName := orderedField.responseName
		fieldASTs := orderedField.fieldASTs
		fieldPath := p.Path.WithKey(responseName)
		resolved, state := resolveField(p.ExecutionContext, p.ParentType, p.Source, fieldASTs, fieldPath)
		if state.hasNoFieldDefs {
			continue
		}
		finalResults[responseName] = resolved
	}
	dethunkMapDepthFirst(finalResults)

	return &Result{
		Data:   finalResults,
		Errors: p.ExecutionContext.Errors,
	}
}

// Implements the "Evaluating selection sets" section of the spec for "read" mode.
func executeFields(p executeFieldsParams) *Result {
	finalResults := executeSubFields(p)

	dethunkMapWithBreadthFirstTraversal(finalResults)

	return &Result{
		Data:   finalResults,
		Errors: p.ExecutionContext.Errors,
	}
}

func executeSubFields(p executeFieldsParams) map[string]interface{} {

	if p.Source == nil {
		p.Source = map[string]interface{}{}
	}
	if p.Fields == nil {
		p.Fields = map[string][]*ast.Field{}
	}

	finalResults := make(map[string]interface{}, len(p.Fields))
	for responseName, fieldASTs := range p.Fields {
		fieldPath := p.Path.WithKey(responseName)
		resolved, state := resolveField(p.ExecutionContext, p.ParentType, p.Source, fieldASTs, fieldPath)
		if state.hasNoFieldDefs {
			continue
		}
		finalResults[responseName] = resolved
	}

	return finalResults
}

// dethunkQueue is a structure that allows us to execute a classic breadth-first traversal.
type dethunkQueue struct {
	DethunkFuncs []func()
}

func (d *dethunkQueue) push(f func()) {
	d.DethunkFuncs = append(d.DethunkFuncs, f)
}

func (d *dethunkQueue) shift() func() {
	f := d.DethunkFuncs[0]
	d.DethunkFuncs = d.DethunkFuncs[1:]
	return f
}

// dethunkWithBreadthFirstTraversal performs a breadth-first descent of the map, calling any thunks
// in the map values and replacing each thunk with that thunk's return value. This parallels
// the reference graphql-js implementation, which calls Promise.all on thunks at each depth (which
// is an implicit parallel descent).
func dethunkMapWithBreadthFirstTraversal(finalResults map[string]interface{}) {
	dethunkQueue := &dethunkQueue{DethunkFuncs: []func(){}}
	dethunkMapBreadthFirst(finalResults, dethunkQueue)
	for len(dethunkQueue.DethunkFuncs) > 0 {
		f := dethunkQueue.shift()
		f()
	}
}

func dethunkMapBreadthFirst(m map[string]interface{}, dethunkQueue *dethunkQueue) {
	for k, v := range m {
		if f, ok := v.(func() interface{}); ok {
			m[k] = f()
		}
		switch val := m[k].(type) {
		case map[string]interface{}:
			dethunkQueue.push(func() { dethunkMapBreadthFirst(val, dethunkQueue) })
		case []interface{}:
			dethunkQueue.push(func() { dethunkListBreadthFirst(val, dethunkQueue) })
		}
	}
}

func dethunkListBreadthFirst(list []interface{}, dethunkQueue *dethunkQueue) {
	for i, v := range list {
		if f, ok := v.(func() interface{}); ok {
			list[i] = f()
		}
		switch val := list[i].(type) {
		case map[string]interface{}:
			dethunkQueue.push(func() { dethunkMapBreadthFirst(val, dethunkQueue) })
		case []interface{}:
			dethunkQueue.push(func() { dethunkListBreadthFirst(val, dethunkQueue) })
		}
	}
}

// dethunkMapDepthFirst performs a serial descent of the map, calling any thunks
// in the map values and replacing each thunk with that thunk's return value. This is needed
// to conform to the graphql-js reference implementation, which requires serial (depth-first)
// implementations for mutation selects.
func dethunkMapDepthFirst(m map[string]interface{}) {
	for k, v := range m {
		if f, ok := v.(func() interface{}); ok {
			m[k] = f()
		}
		switch val := m[k].(type) {
		case map[string]interface{}:
			dethunkMapDepthFirst(val)
		case []interface{}:
			dethunkListDepthFirst(val)
		}
	}
}

func dethunkListDepthFirst(list []interface{}) {
	for i, v := range list {
		if f, ok := v.(func() interface{}); ok {
			list[i] = f()
		}
		switch val := list[i].(type) {
		case map[string]interface{}:
			dethunkMapDepthFirst(val)
		case []interface{}:
			dethunkListDepthFirst(val)
		}
	}
}

type collectFieldsParams struct {
	ExeContext           *executionContext
	RuntimeType          *Object // previously known as OperationType
	SelectionSet         *ast.SelectionSet
	Fields               map[string][]*ast.Field
	VisitedFragmentNames map[string]bool
}

// Given a selectionSet, adds all of the fields in that selection to
// the passed in map of fields, and returns it at the end.
// CollectFields requires the "runtime type" of an object. For a field which
// returns and Interface or Union type, the "runtime type" will be the actual
// Object type returned by that field.
func collectFields(p collectFieldsParams) (fields map[string][]*ast.Field) {
	// overlying SelectionSet & Fields to fields
	if p.SelectionSet == nil {
		return p.Fields
	}
	fields = p.Fields
	if fields == nil {
		fields = map[string][]*ast.Field{}
	}
	if p.VisitedFragmentNames == nil {
		p.VisitedFragmentNames = map[string]bool{}
	}
	for _, iSelection := range p.SelectionSet.Selections {
		switch selection := iSelection.(type) {
		case *ast.Field:
			if !shouldIncludeNode(p.ExeContext, selection.Directives) {
				continue
			}
			name := getFieldEntryKey(selection)
			if _, ok := fields[name]; !ok {
				fields[name] = []*ast.Field{}
			}
			fields[name] = append(fields[name], selection)
		case *ast.InlineFragment:

			if !shouldIncludeNode(p.ExeContext, selection.Directives) ||
				!doesFragmentConditionMatch(p.ExeContext, selection, p.RuntimeType) {
				continue
			}
			innerParams := collectFieldsParams{
				ExeContext:           p.ExeContext,
				RuntimeType:          p.RuntimeType,
				SelectionSet:         selection.SelectionSet,
				Fields:               fields,
				VisitedFragmentNames: p.VisitedFragmentNames,
			}
			collectFields(innerParams)
		case *ast.FragmentSpread:
			fragName := ""
			if selection.Name != nil {
				fragName = selection.Name.Value
			}
			if visited, ok := p.VisitedFragmentNames[fragName]; (ok && visited) ||
				!shouldIncludeNode(p.ExeContext, selection.Directives) {
				continue
			}
			p.VisitedFragmentNames[fragName] = true
			fragment, hasFragment := p.ExeContext.Fragments[fragName]
			if !hasFragment {
				continue
			}

			if fragment, ok := fragment.(*ast.FragmentDefinition); ok {
				if !doesFragmentConditionMatch(p.ExeContext, fragment, p.RuntimeType) {
					continue
				}
				innerParams := collectFieldsParams{
					ExeContext:           p.ExeContext,
					RuntimeType:          p.RuntimeType,
					SelectionSet:         fragment.GetSelectionSet(),
					Fields:               fields,
					VisitedFragmentNames: p.VisitedFragmentNames,
				}
				collectFields(innerParams)
			}
		}
	}
	return fields
}

// Determines if a field should be included based on the @include and @skip
// directives, where @skip has higher precedence than @include.
func shouldIncludeNode(eCtx *executionContext, directives []*ast.Directive) bool {
	var (
		skipAST, includeAST *ast.Directive
		argValues           map[string]interface{}
	)
	for _, directive := range directives {
		if directive == nil || directive.Name == nil {
			continue
		}
		switch directive.Name.Value {
		case SkipDirective.Name:
			skipAST = directive
		case IncludeDirective.Name:
			includeAST = directive
		}
	}
	// precedence: skipAST > includeAST
	if skipAST != nil {
		argValues = getArgumentValues(SkipDirective.Args, skipAST.Arguments, eCtx.VariableValues)
		if skipIf, ok := argValues["if"].(bool); ok && skipIf {
			return false // excluded selectionSet's fields
		}
	}
	if includeAST != nil {
		argValues = getArgumentValues(IncludeDirective.Args, includeAST.Arguments, eCtx.VariableValues)
		if includeIf, ok := argValues["if"].(bool); ok && !includeIf {
			return false // excluded selectionSet's fields
		}
	}
	return true
}

// Determines if a fragment is applicable to the given type.
func doesFragmentConditionMatch(eCtx *executionContext, fragment ast.Node, ttype *Object) bool {

	switch fragment := fragment.(type) {
	case *ast.FragmentDefinition:
		typeConditionAST := fragment.TypeCondition
		if typeConditionAST == nil {
			return true
		}
		conditionalType, err := typeFromAST(eCtx.Schema, typeConditionAST)
		if err != nil {
			return false
		}
		if conditionalType == ttype {
			return true
		}
		if conditionalType.Name() == ttype.Name() {
			return true
		}
		if conditionalType, ok := conditionalType.(*Interface); ok {
			return eCtx.Schema.IsPossibleType(conditionalType, ttype)
		}
		if conditionalType, ok := conditionalType.(*Union); ok {
			return eCtx.Schema.IsPossibleType(conditionalType, ttype)
		}
	case *ast.InlineFragment:
		typeConditionAST := fragment.TypeCondition
		if typeConditionAST == nil {
			return true
		}
		conditionalType, err := typeFromAST(eCtx.Schema, typeConditionAST)
		if err != nil {
			return false
		}
		if conditionalType == ttype {
			return true
		}
		if conditionalType.Name() == ttype.Name() {
			return true
		}
		if conditionalType, ok := conditionalType.(*Interface); ok {
			return eCtx.Schema.IsPossibleType(conditionalType, ttype)
		}
		if conditionalType, ok := conditionalType.(*Union); ok {
			return eCtx.Schema.IsPossibleType(conditionalType, ttype)
		}
	}

	return false
}

// Implements the logic to compute the key of a given field’s entry
func getFieldEntryKey(node *ast.Field) string {

	if node.Alias != nil && node.Alias.Value != "" {
		return node.Alias.Value
	}
	if node.Name != nil && node.Name.Value != "" {
		return node.Name.Value
	}
	return ""
}

// Internal resolveField state
type resolveFieldResultState struct {
	hasNoFieldDefs bool
}

func handleFieldError(r interface{}, fieldNodes []ast.Node, path *ResponsePath, returnType Output, eCtx *executionContext) {
	err := NewLocatedErrorWithPath(r, fieldNodes, path.AsArray())
	// send panic upstream
	if _, ok := returnType.(*NonNull); ok {
		panic(err)
	}
	eCtx.Errors = append(eCtx.Errors, gqlerrors.FormatError(err))
}

// Resolves the field on the given source object. In particular, this
// figures out the value that the field returns by calling its resolve function,
// then calls completeValue to complete promises, serialize scalars, or execute
// the sub-selection-set for objects.
func resolveField(eCtx *executionContext, parentType *Object, source interface{}, fieldASTs []*ast.Field, path *ResponsePath) (result interface{}, resultState resolveFieldResultState) {
	// catch panic from resolveFn
	var returnType Output
	defer func() (interface{}, resolveFieldResultState) {
		if r := recover(); r != nil {
			handleFieldError(r, FieldASTsToNodeASTs(fieldASTs), path, returnType, eCtx)
			return result, resultState
		}
		return result, resultState
	}()

	fieldAST := fieldASTs[0]
	fieldName := ""
	if fieldAST.Name != nil {
		fieldName = fieldAST.Name.Value
	}

	fieldDef := getFieldDef(eCtx.Schema, parentType, fieldName)
	if fieldDef == nil {
		resultState.hasNoFieldDefs = true
		return nil, resultState
	}
	returnType = fieldDef.Type
	resolveFn := fieldDef.Resolve
	if resolveFn == nil {
		resolveFn = DefaultResolveFn
	}

	// Build a map of arguments from the field.arguments AST, using the
	// variables scope to fulfill any variable references.
	// TODO: find a way to memoize, in case this field is within a List type.
	args := getArgumentValues(fieldDef.Args, fieldAST.Arguments, eCtx.VariableValues)

	info := ResolveInfo{
		FieldName:      fieldName,
		FieldASTs:      fieldASTs,
		Path:           path,
		ReturnType:     returnType,
		ParentType:     parentType,
		Schema:         eCtx.Schema,
		Fragments:      eCtx.Fragments,
		RootValue:      eCtx.Root,
		Operation:      eCtx.Operation,
		VariableValues: eCtx.VariableValues,
	}

	var resolveFnError error

	extErrs, resolveFieldFinishFn := handleExtensionsResolveFieldDidStart(eCtx.Schema.extensions, eCtx, &info)
	if len(extErrs) != 0 {
		eCtx.Errors = append(eCtx.Errors, extErrs...)
	}

	result, resolveFnError = resolveFn(ResolveParams{
		Source:  source,
		Args:    args,
		Info:    info,
		Context: eCtx.Context,
	})

	extErrs = resolveFieldFinishFn(result, resolveFnError)
	if len(extErrs) != 0 {
		eCtx.Errors = append(eCtx.Errors, extErrs...)
	}

	if resolveFnError != nil {
		panic(resolveFnError)
	}

	completed := completeValueCatchingError(eCtx, returnType, fieldASTs, info, path, result)
	return completed, resultState
}

func completeValueCatchingError(eCtx *executionContext, returnType Type, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) (completed interface{}) {
	// catch panic
	defer func() interface{} {
		if r := recover(); r != nil {
			handleFieldError(r, FieldASTsToNodeASTs(fieldASTs), path, returnType, eCtx)
			return completed
		}
		return completed
	}()

	if returnType, ok := returnType.(*NonNull); ok {
		completed := completeValue(eCtx, returnType, fieldASTs, info, path, result)
		return completed
	}
	completed = completeValue(eCtx, returnType, fieldASTs, info, path, result)
	return completed
}

func completeValue(eCtx *executionContext, returnType Type, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) interface{} {

	resultVal := reflect.ValueOf(result)
	if resultVal.IsValid() && resultVal.Kind() == reflect.Func {
		return func() interface{} {
			return completeThunkValueCatchingError(eCtx, returnType, fieldASTs, info, path, result)
		}
	}

	// If field type is NonNull, complete for inner type, and throw field error
	// if result is null.
	if returnType, ok := returnType.(*NonNull); ok {
		completed := completeValue(eCtx, returnType.OfType, fieldASTs, info, path, result)
		if completed == nil {
			err := NewLocatedErrorWithPath(
				fmt.Sprintf("Cannot return null for non-nullable field %v.%v.", info.ParentType, info.FieldName),
				FieldASTsToNodeASTs(fieldASTs),
				path.AsArray(),
			)
			panic(gqlerrors.FormatError(err))
		}
		return completed
	}

	// If result value is null-ish (null, undefined, or NaN) then return null.
	if isNullish(result) {
		return nil
	}

	// If field type is List, complete each item in the list with the inner type
	if returnType, ok := returnType.(*List); ok {
		return completeListValue(eCtx, returnType, fieldASTs, info, path, result)
	}

	// If field type is a leaf type, Scalar or Enum, serialize to a valid value,
	// returning null if serialization is not possible.
	if returnType, ok := returnType.(*Scalar); ok {
		return completeLeafValue(returnType, result)
	}
	if returnType, ok := returnType.(*Enum); ok {
		return completeLeafValue(returnType, result)
	}

	// If field type is an abstract type, Interface or Union, determine the
	// runtime Object type and complete for that type.
	if returnType, ok := returnType.(*Union); ok {
		return completeAbstractValue(eCtx, returnType, fieldASTs, info, path, result)
	}
	if returnType, ok := returnType.(*Interface); ok {
		return completeAbstractValue(eCtx, returnType, fieldASTs, info, path, result)
	}

	// If field type is Object, execute and complete all sub-selections.
	if returnType, ok := returnType.(*Object); ok {
		return completeObjectValue(eCtx, returnType, fieldASTs, info, path, result)
	}

	// Not reachable. All possible output types have been considered.
	err := invariantf(false,
		`Cannot complete value of unexpected type "%v."`, returnType)

	if err != nil {
		panic(gqlerrors.FormatError(err))
	}
	return nil
}

func completeThunkValueCatchingError(eCtx *executionContext, returnType Type, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) (completed interface{}) {

	// catch any panic invoked from the propertyFn (thunk)
	defer func() {
		if r := recover(); r != nil {
			handleFieldError(r, FieldASTsToNodeASTs(fieldASTs), path, returnType, eCtx)
		}
	}()

	propertyFn, ok := result.(func() (interface{}, error))
	if !ok {
		err := gqlerrors.NewFormattedError("Error resolving func. Expected `func() (interface{}, error)` signature")
		panic(gqlerrors.FormatError(err))
	}
	fnResult, err := propertyFn()
	if err != nil {
		panic(gqlerrors.FormatError(err))
	}

	result = fnResult

	if returnType, ok := returnType.(*NonNull); ok {
		completed := completeValue(eCtx, returnType, fieldASTs, info, path, result)
		return completed
	}
	completed = completeValue(eCtx, returnType, fieldASTs, info, path, result)

	return completed
}

// completeAbstractValue completes value of an Abstract type (Union / Interface) by determining the runtime type
// of that value, then completing based on that type.
func completeAbstractValue(eCtx *executionContext, returnType Abstract, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) interface{} {

	var runtimeType *Object

	resolveTypeParams := ResolveTypeParams{
		Value:   result,
		Info:    info,
		Context: eCtx.Context,
	}
	if unionReturnType, ok := returnType.(*Union); ok && unionReturnType.ResolveType != nil {
		runtimeType = unionReturnType.ResolveType(resolveTypeParams)
	} else if interfaceReturnType, ok := returnType.(*Interface); ok && interfaceReturnType.ResolveType != nil {
		runtimeType = interfaceReturnType.ResolveType(resolveTypeParams)
	} else {
		runtimeType = defaultResolveTypeFn(resolveTypeParams, returnType)
	}

	err := invariantf(runtimeType != nil, `Abstract type %v must resolve to an Object type at runtime `+
		`for field %v.%v with value "%v", received "%v".`, returnType, info.ParentType, info.FieldName, result, runtimeType,
	)
	if err != nil {
		panic(err)
	}

	if !eCtx.Schema.IsPossibleType(returnType, runtimeType) {
		panic(gqlerrors.NewFormattedError(
			fmt.Sprintf(`Runtime Object type "%v" is not a possible type `+
				`for "%v".`, runtimeType, returnType),
		))
	}

	return completeObjectValue(eCtx, runtimeType, fieldASTs, info, path, result)
}

// completeObjectValue complete an Object value by executing all sub-selections.
func completeObjectValue(eCtx *executionContext, returnType *Object, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) interface{} {

	// If there is an isTypeOf predicate function, call it with the
	// current result. If isTypeOf returns false, then raise an error rather
	// than continuing execution.
	if returnType.IsTypeOf != nil {
		p := IsTypeOfParams{
			Value:   result,
			Info:    info,
			Context: eCtx.Context,
		}
		if !returnType.IsTypeOf(p) {
			panic(gqlerrors.NewFormattedError(
				fmt.Sprintf(`Expected value of type "%v" but got: %T.`, returnType, result),
			))
		}
	}

	// Collect sub-fields to execute to complete this value.
	subFieldASTs := map[string][]*ast.Field{}
	visitedFragmentNames := map[string]bool{}
	for _, fieldAST := range fieldASTs {
		if fieldAST == nil {
			continue
		}
		selectionSet := fieldAST.SelectionSet
		if selectionSet != nil {
			innerParams := collectFieldsParams{
				ExeContext:           eCtx,
				RuntimeType:          returnType,
				SelectionSet:         selectionSet,
				Fields:               subFieldASTs,
				VisitedFragmentNames: visitedFragmentNames,
			}
			subFieldASTs = collectFields(innerParams)
		}
	}
	executeFieldsParams := executeFieldsParams{
		ExecutionContext: eCtx,
		ParentType:       returnType,
		Source:           result,
		Fields:           subFieldASTs,
		Path:             path,
	}
	return executeSubFields(executeFieldsParams)
}

// completeLeafValue complete a leaf value (Scalar / Enum) by serializing to a valid value, returning nil if serialization is not possible.
func completeLeafValue(returnType Leaf, result interface{}) interface{} {
	serializedResult := returnType.Serialize(result)
	if isNullish(serializedResult) {
		return nil
	}
	return serializedResult
}

// completeListValue complete a list value by completing each item in the list with the inner type
func completeListValue(eCtx *executionContext, returnType *List, fieldASTs []*ast.Field, info ResolveInfo, path *ResponsePath, result interface{}) interface{} {
	resultVal := reflect.ValueOf(result)
	if resultVal.Kind() == reflect.Ptr {
		resultVal = resultVal.Elem()
	}
	parentTypeName := ""
	if info.ParentType != nil {
		parentTypeName = info.ParentType.Name()
	}
	err := invariantf(
		resultVal.IsValid() && isIterable(result),
		"User Error: expected iterable, but did not find one "+
			"for field %v.%v.", parentTypeName, info.FieldName)

	if err != nil {
		panic(gqlerrors.FormatError(err))
	}

	itemType := returnType.OfType
	completedResults := make([]interface{}, 0, resultVal.Len())
	for i := 0; i < resultVal.Len(); i++ {
		val := resultVal.Index(i).Interface()
		fieldPath := path.WithKey(i)
		completedItem := completeValueCatchingError(eCtx, itemType, fieldASTs, info, fieldPath, val)
		completedResults = append(completedResults, completedItem)
	}
	return completedResults
}

// defaultResolveTypeFn If a resolveType function is not given, then a default resolve behavior is
// used which tests each possible type for the abstract type by calling
// isTypeOf for the object being coerced, returning the first type that matches.
func defaultResolveTypeFn(p ResolveTypeParams, abstractType Abstract) *Object {
	possibleTypes := p.Info.Schema.PossibleTypes(abstractType)
	for _, possibleType := range possibleTypes {
		if possibleType.IsTypeOf == nil {
			continue
		}
		isTypeOfParams := IsTypeOfParams{
			Value:   p.Value,
			Info:    p.Info,
			Context: p.Context,
		}
		if res := possibleType.IsTypeOf(isTypeOfParams); res {
			return possibleType
		}
	}
	return nil
}

// FieldResolver is used in DefaultResolveFn when the the source value implements this interface.
type FieldResolver interface {
	// Resolve resolves the value for the given ResolveParams. It has the same semantics as FieldResolveFn.
	Resolve(p ResolveParams) (interface{}, error)
}

// DefaultResolveFn If a resolve function is not given, then a default resolve behavior is used
// which takes the property of the source object of the same name as the field
// and returns it as the result, or if it's a function, returns the result
// of calling that function.
func DefaultResolveFn(p ResolveParams) (interface{}, error) {
	sourceVal := reflect.ValueOf(p.Source)
	// Check if value implements 'Resolver' interface
	if resolver, ok := sourceVal.Interface().(FieldResolver); ok {
		return resolver.Resolve(p)
	}

	// try to resolve p.Source as a struct
	if sourceVal.IsValid() && sourceVal.Type().Kind() == reflect.Ptr {
		sourceVal = sourceVal.Elem()
	}
	if !sourceVal.IsValid() {
		return nil, nil
	}

	if sourceVal.Type().Kind() == reflect.Struct {
		for i := 0; i < sourceVal.NumField(); i++ {
			valueField := sourceVal.Field(i)
			typeField := sourceVal.Type().Field(i)
			// try matching the field name first
			if strings.EqualFold(typeField.Name, p.Info.FieldName) {
				return valueField.Interface(), nil
			}
			tag := typeField.Tag
			checkTag := func(tagName string) bool {
				t := tag.Get(tagName)
				tOptions := strings.Split(t, ",")
				if len(tOptions) == 0 {
					return false
				}
				if tOptions[0] != p.Info.FieldName {
					return false
				}
				return true
			}
			if checkTag("json") || checkTag("graphql") {
				return valueField.Interface(), nil
			} else {
				continue
Download .txt
gitextract_a97o64la/

├── .circleci/
│   └── config.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── abstract_test.go
├── benchutil/
│   ├── list_schema.go
│   └── wide_schema.go
├── definition.go
├── definition_test.go
├── directives.go
├── directives_test.go
├── enum_type_test.go
├── examples/
│   ├── concurrent-resolvers/
│   │   └── main.go
│   ├── context/
│   │   └── main.go
│   ├── crud/
│   │   ├── Readme.md
│   │   └── main.go
│   ├── custom-scalar-type/
│   │   └── main.go
│   ├── hello-world/
│   │   └── main.go
│   ├── http/
│   │   ├── data.json
│   │   └── main.go
│   ├── http-post/
│   │   └── main.go
│   ├── httpdynamic/
│   │   ├── README.md
│   │   ├── data.json
│   │   └── main.go
│   ├── modify-context/
│   │   └── main.go
│   ├── sql-nullstring/
│   │   ├── README.md
│   │   └── main.go
│   ├── star-wars/
│   │   └── main.go
│   └── todo/
│       ├── README.md
│       ├── main.go
│       ├── schema/
│       │   └── schema.go
│       └── static/
│           ├── assets/
│           │   ├── css/
│           │   │   └── style.css
│           │   └── js/
│           │       └── app.js
│           └── index.html
├── executor.go
├── executor_resolve_test.go
├── executor_schema_test.go
├── executor_test.go
├── extensions.go
├── extensions_test.go
├── go.mod
├── gqlerrors/
│   ├── error.go
│   ├── formatted.go
│   ├── located.go
│   ├── sortutil.go
│   └── syntax.go
├── graphql.go
├── graphql_bench_test.go
├── graphql_test.go
├── introspection.go
├── introspection_test.go
├── kitchen-sink.graphql
├── language/
│   ├── ast/
│   │   ├── arguments.go
│   │   ├── definitions.go
│   │   ├── directives.go
│   │   ├── document.go
│   │   ├── location.go
│   │   ├── name.go
│   │   ├── node.go
│   │   ├── selections.go
│   │   ├── type_definitions.go
│   │   ├── types.go
│   │   └── values.go
│   ├── kinds/
│   │   └── kinds.go
│   ├── lexer/
│   │   ├── lexer.go
│   │   └── lexer_test.go
│   ├── location/
│   │   └── location.go
│   ├── parser/
│   │   ├── parser.go
│   │   ├── parser_test.go
│   │   └── schema_parser_test.go
│   ├── printer/
│   │   ├── printer.go
│   │   ├── printer_test.go
│   │   └── schema_printer_test.go
│   ├── source/
│   │   └── source.go
│   ├── typeInfo/
│   │   └── type_info.go
│   └── visitor/
│       ├── visitor.go
│       └── visitor_test.go
├── lists_test.go
├── located.go
├── mutations_test.go
├── nonnull_test.go
├── quoted_or_list_internal_test.go
├── race_test.go
├── rules.go
├── rules_arguments_of_correct_type_test.go
├── rules_default_values_of_correct_type_test.go
├── rules_fields_on_correct_type_test.go
├── rules_fragments_on_composite_types_test.go
├── rules_known_argument_names_test.go
├── rules_known_directives_rule_test.go
├── rules_known_fragment_names_test.go
├── rules_known_type_names_test.go
├── rules_lone_anonymous_operation_rule_test.go
├── rules_no_fragment_cycles_test.go
├── rules_no_undefined_variables_test.go
├── rules_no_unused_fragments_test.go
├── rules_no_unused_variables_test.go
├── rules_overlapping_fields_can_be_merged.go
├── rules_overlapping_fields_can_be_merged_test.go
├── rules_possible_fragment_spreads_test.go
├── rules_provided_non_null_arguments_test.go
├── rules_scalar_leafs_test.go
├── rules_unique_argument_names_test.go
├── rules_unique_fragment_names_test.go
├── rules_unique_input_field_names_test.go
├── rules_unique_operation_names_test.go
├── rules_unique_variable_names_test.go
├── rules_variables_are_input_types_test.go
├── rules_variables_in_allowed_position_test.go
├── scalars.go
├── scalars_parse_test.go
├── scalars_serialization_test.go
├── scalars_test.go
├── schema-all-descriptions.graphql
├── schema-kitchen-sink.graphql
├── schema.go
├── subscription.go
├── subscription_test.go
├── suggested_list_internal_test.go
├── testutil/
│   ├── introspection_query.go
│   ├── rules_test_harness.go
│   ├── subscription.go
│   ├── testutil.go
│   └── testutil_test.go
├── type_comparators_internal_test.go
├── type_info.go
├── types.go
├── union_interface_test.go
├── util.go
├── util_test.go
├── validation_test.go
├── validator.go
├── validator_test.go
├── values.go
├── values_test.go
└── variables_test.go
Download .txt
Showing preview only (216K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (1839 symbols across 118 files)

FILE: abstract_test.go
  type testDog (line 13) | type testDog struct
  type testCat (line 18) | type testCat struct
  type testHuman (line 23) | type testHuman struct
  function TestIsTypeOfUsedToResolveRuntimeTypeForInterface (line 27) | func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
  function TestAppendTypeUsedToAddRuntimeCustomScalarTypeForInterface (line 161) | func TestAppendTypeUsedToAddRuntimeCustomScalarTypeForInterface(t *testi...
  function TestIsTypeOfUsedToResolveRuntimeTypeForUnion (line 298) | func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {
  function TestResolveTypeOnInterfaceYieldsUsefulError (line 398) | func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
  function TestResolveTypeOnUnionYieldsUsefulError (line 534) | func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {

FILE: benchutil/list_schema.go
  type color (line 9) | type color struct
  function ListSchemaWithXItems (line 16) | func ListSchemaWithXItems(x int) graphql.Schema {
  function init (line 88) | func init() {
  function generateXListItems (line 105) | func generateXListItems(x int) []color {

FILE: benchutil/wide_schema.go
  function WideSchemaWithXFieldsAndYItems (line 9) | func WideSchemaWithXFieldsAndYItems(x int, y int) graphql.Schema {
  function generateXWideFields (line 39) | func generateXWideFields(x int) graphql.Fields {
  function generateWideFieldFromX (line 47) | func generateWideFieldFromX(x int) *graphql.Field {
  function generateWideTypeFromX (line 54) | func generateWideTypeFromX(x int) graphql.Type {
  function generateFieldNameFromX (line 77) | func generateFieldNameFromX(x int) string {
  function generateWideResolveFromX (line 92) | func generateWideResolveFromX(x int) func(p graphql.ResolveParams) (inte...
  function WideSchemaQuery (line 137) | func WideSchemaQuery(x int) string {

FILE: definition.go
  type Type (line 13) | type Type interface
  type Input (line 31) | type Input interface
  function IsInputType (line 45) | func IsInputType(ttype Type) bool {
  function IsOutputType (line 55) | func IsOutputType(ttype Type) bool {
  type Leaf (line 65) | type Leaf interface
  function IsLeafType (line 77) | func IsLeafType(ttype Type) bool {
  type Output (line 87) | type Output interface
  type Composite (line 103) | type Composite interface
  function IsCompositeType (line 115) | func IsCompositeType(ttype interface{}) bool {
  type Abstract (line 125) | type Abstract interface
  function IsAbstractType (line 132) | func IsAbstractType(ttype interface{}) bool {
  type Nullable (line 142) | type Nullable interface
  function GetNullable (line 154) | func GetNullable(ttype Type) Nullable {
  type Named (line 162) | type Named interface
  function GetNamed (line 174) | func GetNamed(ttype Type) Named {
  type Scalar (line 202) | type Scalar struct
    method Serialize (line 270) | func (st *Scalar) Serialize(value interface{}) interface{} {
    method ParseValue (line 276) | func (st *Scalar) ParseValue(value interface{}) interface{} {
    method ParseLiteral (line 282) | func (st *Scalar) ParseLiteral(valueAST ast.Value) interface{} {
    method Name (line 288) | func (st *Scalar) Name() string {
    method Description (line 291) | func (st *Scalar) Description() string {
    method String (line 295) | func (st *Scalar) String() string {
    method Error (line 298) | func (st *Scalar) Error() error {
  type SerializeFn (line 211) | type SerializeFn
  type ParseValueFn (line 214) | type ParseValueFn
  type ParseLiteralFn (line 217) | type ParseLiteralFn
  type ScalarConfig (line 220) | type ScalarConfig struct
  function NewScalar (line 229) | func NewScalar(config ScalarConfig) *Scalar {
  type Object (line 337) | type Object struct
    method ensureCache (line 404) | func (gt *Object) ensureCache() {
    method AddFieldConfig (line 408) | func (gt *Object) AddFieldConfig(fieldName string, fieldConfig *Field) {
    method Name (line 417) | func (gt *Object) Name() string {
    method Description (line 420) | func (gt *Object) Description() string {
    method String (line 423) | func (gt *Object) String() string {
    method Fields (line 426) | func (gt *Object) Fields() FieldDefinitionMap {
    method Interfaces (line 444) | func (gt *Object) Interfaces() []*Interface {
    method Error (line 467) | func (gt *Object) Error() error {
  type IsTypeOfParams (line 352) | type IsTypeOfParams struct
  type IsTypeOfFn (line 366) | type IsTypeOfFn
  type InterfacesThunk (line 368) | type InterfacesThunk
  type ObjectConfig (line 370) | type ObjectConfig struct
  type FieldsThunk (line 378) | type FieldsThunk
  function NewObject (line 380) | func NewObject(config ObjectConfig) *Object {
  function defineInterfaces (line 471) | func defineInterfaces(ttype *Object, interfaces []*Interface) ([]*Interf...
  function defineFieldMap (line 503) | func defineFieldMap(ttype Named, fieldMap Fields) (FieldDefinitionMap, e...
  type ResolveParams (line 571) | type ResolveParams struct
  type FieldResolveFn (line 587) | type FieldResolveFn
  type ResolveInfo (line 589) | type ResolveInfo struct
  type Fields (line 602) | type Fields
  type Field (line 604) | type Field struct
  type FieldConfigArgument (line 614) | type FieldConfigArgument
  type ArgumentConfig (line 616) | type ArgumentConfig struct
  type FieldDefinitionMap (line 622) | type FieldDefinitionMap
  type FieldDefinition (line 623) | type FieldDefinition struct
  type FieldArgument (line 633) | type FieldArgument struct
  type Argument (line 640) | type Argument struct
    method Name (line 647) | func (st *Argument) Name() string {
    method Description (line 650) | func (st *Argument) Description() string {
    method String (line 654) | func (st *Argument) String() string {
    method Error (line 657) | func (st *Argument) Error() error {
  type Interface (line 676) | type Interface struct
    method AddFieldConfig (line 727) | func (it *Interface) AddFieldConfig(fieldName string, fieldConfig *Fie...
    method Name (line 737) | func (it *Interface) Name() string {
    method Description (line 741) | func (it *Interface) Description() string {
    method Fields (line 745) | func (it *Interface) Fields() (fields FieldDefinitionMap) {
    method String (line 763) | func (it *Interface) String() string {
    method Error (line 767) | func (it *Interface) Error() error {
  type InterfaceConfig (line 686) | type InterfaceConfig struct
  type ResolveTypeParams (line 694) | type ResolveTypeParams struct
  type ResolveTypeFn (line 708) | type ResolveTypeFn
  function NewInterface (line 710) | func NewInterface(config InterfaceConfig) *Interface {
  type Union (line 791) | type Union struct
    method Types (line 831) | func (ut *Union) Types() []*Object {
    method String (line 888) | func (ut *Union) String() string {
    method Name (line 892) | func (ut *Union) Name() string {
    method Description (line 896) | func (ut *Union) Description() string {
    method Error (line 900) | func (ut *Union) Error() error {
  type UnionTypesThunk (line 804) | type UnionTypesThunk
  type UnionConfig (line 806) | type UnionConfig struct
  function NewUnion (line 813) | func NewUnion(config UnionConfig) *Union {
  function defineUnionTypes (line 854) | func defineUnionTypes(objectType *Union, unionTypes []*Object) ([]*Objec...
  type Enum (line 924) | type Enum struct
    method defineEnumValues (line 969) | func (gt *Enum) defineEnumValues(valueMap EnumValueConfigMap) ([]*Enum...
    method Values (line 1004) | func (gt *Enum) Values() []*EnumValueDefinition {
    method Serialize (line 1007) | func (gt *Enum) Serialize(value interface{}) interface{} {
    method ParseValue (line 1020) | func (gt *Enum) ParseValue(value interface{}) interface{} {
    method ParseLiteral (line 1036) | func (gt *Enum) ParseLiteral(valueAST ast.Value) interface{} {
    method Name (line 1044) | func (gt *Enum) Name() string {
    method Description (line 1047) | func (gt *Enum) Description() string {
    method String (line 1050) | func (gt *Enum) String() string {
    method Error (line 1053) | func (gt *Enum) Error() error {
    method getValueLookup (line 1056) | func (gt *Enum) getValueLookup() map[interface{}]*EnumValueDefinition {
    method getNameLookup (line 1068) | func (gt *Enum) getNameLookup() map[string]*EnumValueDefinition {
  type EnumValueConfigMap (line 935) | type EnumValueConfigMap
  type EnumValueConfig (line 936) | type EnumValueConfig struct
  type EnumConfig (line 941) | type EnumConfig struct
  type EnumValueDefinition (line 946) | type EnumValueDefinition struct
  function NewEnum (line 953) | func NewEnum(config EnumConfig) *Enum {
  type InputObject (line 1097) | type InputObject struct
    method defineFieldMap (line 1152) | func (gt *InputObject) defineFieldMap() InputObjectFieldMap {
    method AddFieldConfig (line 1196) | func (gt *InputObject) AddFieldConfig(fieldName string, fieldConfig *I...
    method Fields (line 1208) | func (gt *InputObject) Fields() InputObjectFieldMap {
    method Name (line 1214) | func (gt *InputObject) Name() string {
    method Description (line 1217) | func (gt *InputObject) Description() string {
    method String (line 1220) | func (gt *InputObject) String() string {
    method Error (line 1223) | func (gt *InputObject) Error() error {
  type InputObjectFieldConfig (line 1106) | type InputObjectFieldConfig struct
  type InputObjectField (line 1111) | type InputObjectField struct
    method Name (line 1118) | func (st *InputObjectField) Name() string {
    method Description (line 1121) | func (st *InputObjectField) Description() string {
    method String (line 1124) | func (st *InputObjectField) String() string {
    method Error (line 1127) | func (st *InputObjectField) Error() error {
  type InputObjectConfigFieldMap (line 1131) | type InputObjectConfigFieldMap
  type InputObjectFieldMap (line 1132) | type InputObjectFieldMap
  type InputObjectConfigFieldMapThunk (line 1133) | type InputObjectConfigFieldMapThunk
  type InputObjectConfig (line 1134) | type InputObjectConfig struct
  function NewInputObject (line 1140) | func NewInputObject(config InputObjectConfig) *InputObject {
  type List (line 1242) | type List struct
    method Name (line 1259) | func (gl *List) Name() string {
    method Description (line 1262) | func (gl *List) Description() string {
    method String (line 1265) | func (gl *List) String() string {
    method Error (line 1271) | func (gl *List) Error() error {
  function NewList (line 1248) | func NewList(ofType Type) *List {
  type NonNull (line 1293) | type NonNull struct
    method Name (line 1310) | func (gl *NonNull) Name() string {
    method Description (line 1313) | func (gl *NonNull) Description() string {
    method String (line 1316) | func (gl *NonNull) String() string {
    method Error (line 1322) | func (gl *NonNull) Error() error {
  function NewNonNull (line 1299) | func NewNonNull(ofType Type) *NonNull {
  function assertValidName (line 1328) | func assertValidName(name string) error {
  type ResponsePath (line 1335) | type ResponsePath struct
    method WithKey (line 1341) | func (p *ResponsePath) WithKey(key interface{}) *ResponsePath {
    method AsArray (line 1349) | func (p *ResponsePath) AsArray() []interface{} {

FILE: definition_test.go
  function init (line 140) | func init() {
  function TestTypeSystem_DefinitionExample_DefinesAQueryOnlySchema (line 146) | func TestTypeSystem_DefinitionExample_DefinesAQueryOnlySchema(t *testing...
  function TestTypeSystem_DefinitionExample_DefinesAMutationScheme (line 222) | func TestTypeSystem_DefinitionExample_DefinesAMutationScheme(t *testing....
  function TestTypeSystem_DefinitionExample_DefinesASubscriptionScheme (line 251) | func TestTypeSystem_DefinitionExample_DefinesASubscriptionScheme(t *test...
  function TestTypeSystem_DefinitionExample_IncludesNestedInputObjectsInTheMap (line 280) | func TestTypeSystem_DefinitionExample_IncludesNestedInputObjectsInTheMap...
  function TestTypeSystem_DefinitionExample_IncludesInterfacesSubTypesInTheTypeMap (line 336) | func TestTypeSystem_DefinitionExample_IncludesInterfacesSubTypesInTheTyp...
  function TestTypeSystem_DefinitionExample_IncludesInterfacesThunkSubtypesInTheTypeMap (line 378) | func TestTypeSystem_DefinitionExample_IncludesInterfacesThunkSubtypesInT...
  function TestTypeSystem_DefinitionExample_StringifiesSimpleTypes (line 422) | func TestTypeSystem_DefinitionExample_StringifiesSimpleTypes(t *testing....
  function TestTypeSystem_DefinitionExample_IdentifiesInputTypes (line 449) | func TestTypeSystem_DefinitionExample_IdentifiesInputTypes(t *testing.T) {
  function TestTypeSystem_DefinitionExample_IdentifiesOutputTypes (line 476) | func TestTypeSystem_DefinitionExample_IdentifiesOutputTypes(t *testing.T) {
  function TestTypeSystem_DefinitionExample_ProhibitsNestingNonNullInsideNonNull (line 503) | func TestTypeSystem_DefinitionExample_ProhibitsNestingNonNullInsideNonNu...
  function TestTypeSystem_DefinitionExample_ProhibitsNilInNonNull (line 510) | func TestTypeSystem_DefinitionExample_ProhibitsNilInNonNull(t *testing.T) {
  function TestTypeSystem_DefinitionExample_ProhibitsNilTypeInUnions (line 517) | func TestTypeSystem_DefinitionExample_ProhibitsNilTypeInUnions(t *testin...
  function TestTypeSystem_DefinitionExample_DoesNotMutatePassedFieldDefinitions (line 528) | func TestTypeSystem_DefinitionExample_DoesNotMutatePassedFieldDefinition...
  function TestTypeSystem_DefinitionExample_IncludesFieldsThunk (line 603) | func TestTypeSystem_DefinitionExample_IncludesFieldsThunk(t *testing.T) {
  function TestTypeSystem_DefinitionExampe_AllowsCyclicFieldTypes (line 624) | func TestTypeSystem_DefinitionExampe_AllowsCyclicFieldTypes(t *testing.T) {
  function TestTypeSystem_DefinitionExample_CanAddInputObjectField (line 646) | func TestTypeSystem_DefinitionExample_CanAddInputObjectField(t *testing....
  function TestTypeSystem_DefinitionExample_IncludesUnionTypesThunk (line 671) | func TestTypeSystem_DefinitionExample_IncludesUnionTypesThunk(t *testing...
  function TestTypeSystem_DefinitionExample_HandlesInvalidUnionTypes (line 710) | func TestTypeSystem_DefinitionExample_HandlesInvalidUnionTypes(t *testin...
  function TestIsAbstractType (line 732) | func TestIsAbstractType(t *testing.T) {
  function TestGetNullable (line 800) | func TestGetNullable(t *testing.T) {
  function TestNewScalar (line 852) | func TestNewScalar(t *testing.T) {

FILE: directives.go
  constant DirectiveLocationQuery (line 5) | DirectiveLocationQuery              = "QUERY"
  constant DirectiveLocationMutation (line 6) | DirectiveLocationMutation           = "MUTATION"
  constant DirectiveLocationSubscription (line 7) | DirectiveLocationSubscription       = "SUBSCRIPTION"
  constant DirectiveLocationField (line 8) | DirectiveLocationField              = "FIELD"
  constant DirectiveLocationFragmentDefinition (line 9) | DirectiveLocationFragmentDefinition = "FRAGMENT_DEFINITION"
  constant DirectiveLocationFragmentSpread (line 10) | DirectiveLocationFragmentSpread     = "FRAGMENT_SPREAD"
  constant DirectiveLocationInlineFragment (line 11) | DirectiveLocationInlineFragment     = "INLINE_FRAGMENT"
  constant DirectiveLocationSchema (line 14) | DirectiveLocationSchema               = "SCHEMA"
  constant DirectiveLocationScalar (line 15) | DirectiveLocationScalar               = "SCALAR"
  constant DirectiveLocationObject (line 16) | DirectiveLocationObject               = "OBJECT"
  constant DirectiveLocationFieldDefinition (line 17) | DirectiveLocationFieldDefinition      = "FIELD_DEFINITION"
  constant DirectiveLocationArgumentDefinition (line 18) | DirectiveLocationArgumentDefinition   = "ARGUMENT_DEFINITION"
  constant DirectiveLocationInterface (line 19) | DirectiveLocationInterface            = "INTERFACE"
  constant DirectiveLocationUnion (line 20) | DirectiveLocationUnion                = "UNION"
  constant DirectiveLocationEnum (line 21) | DirectiveLocationEnum                 = "ENUM"
  constant DirectiveLocationEnumValue (line 22) | DirectiveLocationEnumValue            = "ENUM_VALUE"
  constant DirectiveLocationInputObject (line 23) | DirectiveLocationInputObject          = "INPUT_OBJECT"
  constant DirectiveLocationInputFieldDefinition (line 24) | DirectiveLocationInputFieldDefinition = "INPUT_FIELD_DEFINITION"
  constant DefaultDeprecationReason (line 28) | DefaultDeprecationReason = "No longer supported"
  type Directive (line 39) | type Directive struct
  type DirectiveConfig (line 49) | type DirectiveConfig struct
  function NewDirective (line 56) | func NewDirective(config DirectiveConfig) *Directive {

FILE: directives_test.go
  function executeDirectivesTestQuery (line 31) | func executeDirectivesTestQuery(t *testing.T, doc string) *graphql.Result {
  function TestDirectives_DirectivesMustBeNamed (line 41) | func TestDirectives_DirectivesMustBeNamed(t *testing.T) {
  function TestDirectives_DirectiveNameMustBeValid (line 65) | func TestDirectives_DirectiveNameMustBeValid(t *testing.T) {
  function TestDirectives_DirectiveNameMustProvideLocations (line 90) | func TestDirectives_DirectiveNameMustProvideLocations(t *testing.T) {
  function TestDirectives_DirectiveArgNamesMustBeValid (line 112) | func TestDirectives_DirectiveArgNamesMustBeValid(t *testing.T) {
  function TestDirectivesWorksWithoutDirectives (line 147) | func TestDirectivesWorksWithoutDirectives(t *testing.T) {
  function TestDirectivesWorksOnScalarsIfTrueIncludesScalar (line 161) | func TestDirectivesWorksOnScalarsIfTrueIncludesScalar(t *testing.T) {
  function TestDirectivesWorksOnScalarsIfFalseOmitsOnScalar (line 175) | func TestDirectivesWorksOnScalarsIfFalseOmitsOnScalar(t *testing.T) {
  function TestDirectivesWorksOnScalarsUnlessFalseIncludesScalar (line 188) | func TestDirectivesWorksOnScalarsUnlessFalseIncludesScalar(t *testing.T) {
  function TestDirectivesWorksOnScalarsUnlessTrueOmitsScalar (line 202) | func TestDirectivesWorksOnScalarsUnlessTrueOmitsScalar(t *testing.T) {
  function TestDirectivesWorksOnFragmentSpreadsIfFalseOmitsFragmentSpread (line 215) | func TestDirectivesWorksOnFragmentSpreadsIfFalseOmitsFragmentSpread(t *t...
  function TestDirectivesWorksOnFragmentSpreadsIfTrueIncludesFragmentSpread (line 236) | func TestDirectivesWorksOnFragmentSpreadsIfTrueIncludesFragmentSpread(t ...
  function TestDirectivesWorksOnFragmentSpreadsUnlessFalseIncludesFragmentSpread (line 258) | func TestDirectivesWorksOnFragmentSpreadsUnlessFalseIncludesFragmentSpre...
  function TestDirectivesWorksOnFragmentSpreadsUnlessTrueOmitsFragmentSpread (line 280) | func TestDirectivesWorksOnFragmentSpreadsUnlessTrueOmitsFragmentSpread(t...
  function TestDirectivesWorksOnInlineFragmentIfFalseOmitsInlineFragment (line 301) | func TestDirectivesWorksOnInlineFragmentIfFalseOmitsInlineFragment(t *te...
  function TestDirectivesWorksOnInlineFragmentIfTrueIncludesInlineFragment (line 321) | func TestDirectivesWorksOnInlineFragmentIfTrueIncludesInlineFragment(t *...
  function TestDirectivesWorksOnInlineFragmentUnlessFalseIncludesInlineFragment (line 342) | func TestDirectivesWorksOnInlineFragmentUnlessFalseIncludesInlineFragmen...
  function TestDirectivesWorksOnInlineFragmentUnlessTrueIncludesInlineFragment (line 363) | func TestDirectivesWorksOnInlineFragmentUnlessTrueIncludesInlineFragment...
  function TestDirectivesWorksOnAnonymousInlineFragmentIfFalseOmitsAnonymousInlineFragment (line 383) | func TestDirectivesWorksOnAnonymousInlineFragmentIfFalseOmitsAnonymousIn...
  function TestDirectivesWorksOnAnonymousInlineFragmentIfTrueIncludesAnonymousInlineFragment (line 403) | func TestDirectivesWorksOnAnonymousInlineFragmentIfTrueIncludesAnonymous...
  function TestDirectivesWorksOnAnonymousInlineFragmentUnlessFalseIncludesAnonymousInlineFragment (line 424) | func TestDirectivesWorksOnAnonymousInlineFragmentUnlessFalseIncludesAnon...
  function TestDirectivesWorksOnAnonymousInlineFragmentUnlessTrueIncludesAnonymousInlineFragment (line 445) | func TestDirectivesWorksOnAnonymousInlineFragmentUnlessTrueIncludesAnony...
  function TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndNoSkip (line 465) | func TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndNoSkip(t ...
  function TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndSkip (line 479) | func TestDirectivesWorksWithSkipAndIncludeDirectives_IncludeAndSkip(t *t...
  function TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeAndSkip (line 492) | func TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeAndSkip(t ...
  function TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeOrSkip (line 505) | func TestDirectivesWorksWithSkipAndIncludeDirectives_NoIncludeOrSkip(t *...

FILE: enum_type_test.go
  function executeEnumTypeTest (line 124) | func executeEnumTypeTest(t *testing.T, query string) *graphql.Result {
  function executeEnumTypeTestWithParams (line 131) | func executeEnumTypeTestWithParams(t *testing.T, query string, params ma...
  function TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInput (line 139) | func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInput(t *testing.T) {
  function TestTypeSystem_EnumValues_EnumMayBeOutputType (line 152) | func TestTypeSystem_EnumValues_EnumMayBeOutputType(t *testing.T) {
  function TestTypeSystem_EnumValues_EnumMayBeBothInputAndOutputType (line 164) | func TestTypeSystem_EnumValues_EnumMayBeBothInputAndOutputType(t *testin...
  function TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals (line 176) | func TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals(t *testing.T) {
  function TestTypeSystem_EnumValues_DoesNotAcceptIncorrectInternalValue (line 194) | func TestTypeSystem_EnumValues_DoesNotAcceptIncorrectInternalValue(t *te...
  function TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLiteral (line 206) | func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLi...
  function TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt (line 225) | func TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt(t *t...
  function TestTypeSystem_EnumValues_AcceptsJSONStringAsEnumVariable (line 244) | func TestTypeSystem_EnumValues_AcceptsJSONStringAsEnumVariable(t *testin...
  function TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToMutations (line 260) | func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToMuta...
  function TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToSubscriptions (line 276) | func TestTypeSystem_EnumValues_AcceptsEnumLiteralsAsInputArgumentsToSubs...
  function TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable (line 291) | func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable(...
  function TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput (line 312) | func TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput(t...
  function TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumInput (line 330) | func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumI...
  function TestTypeSystem_EnumValues_EnumValueMayHaveAnInternalValueOfZero (line 348) | func TestTypeSystem_EnumValues_EnumValueMayHaveAnInternalValueOfZero(t *...
  function TestTypeSystem_EnumValues_EnumValueMayBeNullable (line 364) | func TestTypeSystem_EnumValues_EnumValueMayBeNullable(t *testing.T) {
  function TestTypeSystem_EnumValues_EnumValueMayBePointer (line 381) | func TestTypeSystem_EnumValues_EnumValueMayBePointer(t *testing.T) {
  function TestTypeSystem_EnumValues_EnumValueMayBeNilPointer (line 425) | func TestTypeSystem_EnumValues_EnumValueMayBeNilPointer(t *testing.T) {

FILE: examples/concurrent-resolvers/main.go
  type Foo (line 11) | type Foo struct
  type Bar (line 22) | type Bar struct
  function main (line 70) | func main() {

FILE: examples/context/main.go
  function graphqlHandler (line 42) | func graphqlHandler(w http.ResponseWriter, r *http.Request) {
  function main (line 59) | func main() {
  function init (line 66) | func init() {

FILE: examples/crud/main.go
  type Product (line 14) | type Product struct
  function executeQuery (line 216) | func executeQuery(query string, schema graphql.Schema) *graphql.Result {
  function main (line 227) | func main() {

FILE: examples/custom-scalar-type/main.go
  type CustomID (line 12) | type CustomID struct
    method String (line 16) | func (id *CustomID) String() string {
  function NewCustomID (line 20) | func NewCustomID(v string) *CustomID {
  type Customer (line 61) | type Customer struct
  function main (line 74) | func main() {

FILE: examples/hello-world/main.go
  function main (line 11) | func main() {

FILE: examples/http-post/main.go
  type postData (line 12) | type postData struct
  function main (line 18) | func main() {

FILE: examples/http/main.go
  type user (line 12) | type user struct
  function executeQuery (line 76) | func executeQuery(query string, schema graphql.Schema) *graphql.Result {
  function main (line 87) | func main() {
  function importJSONDataFromFile (line 101) | func importJSONDataFromFile(fileName string, result interface{}) (isOK b...

FILE: examples/httpdynamic/main.go
  constant jsonDataFile (line 22) | jsonDataFile = "data.json"
  function handleSIGUSR1 (line 24) | func handleSIGUSR1(c chan os.Signal) {
  function filterUser (line 36) | func filterUser(data []map[string]interface{}, args map[string]interface...
  function executeQuery (line 50) | func executeQuery(query string, schema graphql.Schema) *graphql.Result {
  function importJSONDataFromFile (line 61) | func importJSONDataFromFile(fileName string) error {
  function main (line 117) | func main() {

FILE: examples/modify-context/main.go
  type User (line 12) | type User struct
  function main (line 34) | func main() {

FILE: examples/sql-nullstring/main.go
  type NullString (line 13) | type NullString struct
    method MarshalJSON (line 18) | func (v NullString) MarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 26) | func (v *NullString) UnmarshalJSON(data []byte) error {
  function NewNullString (line 42) | func NewNullString(value string) *NullString {
  function SerializeNullString (line 54) | func SerializeNullString(value interface{}) interface{} {
  function ParseNullString (line 67) | func ParseNullString(value interface{}) interface{} {
  function ParseLiteralNullString (line 79) | func ParseLiteralNullString(valueAST ast.Value) interface{} {
  type Person (line 105) | type Person struct
  function main (line 123) | func main() {

FILE: examples/star-wars/main.go
  function main (line 12) | func main() {

FILE: examples/todo/main.go
  function init (line 14) | func init() {
  function executeQuery (line 23) | func executeQuery(query string, schema graphql.Schema) *graphql.Result {
  function main (line 34) | func main() {

FILE: examples/todo/schema/schema.go
  type Todo (line 11) | type Todo struct
  function RandStringRunes (line 19) | func RandStringRunes(n int) string {

FILE: executor.go
  type ExecuteParams (line 15) | type ExecuteParams struct
  function Execute (line 27) | func Execute(p ExecuteParams) (result *Result) {
  type buildExecutionCtxParams (line 95) | type buildExecutionCtxParams struct
  type executionContext (line 105) | type executionContext struct
  function buildExecutionContext (line 115) | func buildExecutionContext(p buildExecutionCtxParams) (*executionContext...
  type executeOperationParams (line 161) | type executeOperationParams struct
  function executeOperation (line 167) | func executeOperation(p executeOperationParams) *Result {
  function getOperationRootType (line 194) | func getOperationRootType(schema Schema, operation ast.Definition) (*Obj...
  type executeFieldsParams (line 240) | type executeFieldsParams struct
  function executeFieldsSerially (line 249) | func executeFieldsSerially(p executeFieldsParams) *Result {
  function executeFields (line 277) | func executeFields(p executeFieldsParams) *Result {
  function executeSubFields (line 288) | func executeSubFields(p executeFieldsParams) map[string]interface{} {
  type dethunkQueue (line 311) | type dethunkQueue struct
    method push (line 315) | func (d *dethunkQueue) push(f func()) {
    method shift (line 319) | func (d *dethunkQueue) shift() func() {
  function dethunkMapWithBreadthFirstTraversal (line 329) | func dethunkMapWithBreadthFirstTraversal(finalResults map[string]interfa...
  function dethunkMapBreadthFirst (line 338) | func dethunkMapBreadthFirst(m map[string]interface{}, dethunkQueue *deth...
  function dethunkListBreadthFirst (line 352) | func dethunkListBreadthFirst(list []interface{}, dethunkQueue *dethunkQu...
  function dethunkMapDepthFirst (line 370) | func dethunkMapDepthFirst(m map[string]interface{}) {
  function dethunkListDepthFirst (line 384) | func dethunkListDepthFirst(list []interface{}) {
  type collectFieldsParams (line 398) | type collectFieldsParams struct
  function collectFields (line 411) | func collectFields(p collectFieldsParams) (fields map[string][]*ast.Fiel...
  function shouldIncludeNode (line 483) | func shouldIncludeNode(eCtx *executionContext, directives []*ast.Directi...
  function doesFragmentConditionMatch (line 516) | func doesFragmentConditionMatch(eCtx *executionContext, fragment ast.Nod...
  function getFieldEntryKey (line 567) | func getFieldEntryKey(node *ast.Field) string {
  type resolveFieldResultState (line 579) | type resolveFieldResultState struct
  function handleFieldError (line 583) | func handleFieldError(r interface{}, fieldNodes []ast.Node, path *Respon...
  function resolveField (line 596) | func resolveField(eCtx *executionContext, parentType *Object, source int...
  function completeValueCatchingError (line 669) | func completeValueCatchingError(eCtx *executionContext, returnType Type,...
  function completeValue (line 687) | func completeValue(eCtx *executionContext, returnType Type, fieldASTs []...
  function completeThunkValueCatchingError (line 754) | func completeThunkValueCatchingError(eCtx *executionContext, returnType ...
  function completeAbstractValue (line 786) | func completeAbstractValue(eCtx *executionContext, returnType Abstract, ...
  function completeObjectValue (line 821) | func completeObjectValue(eCtx *executionContext, returnType *Object, fie...
  function completeLeafValue (line 869) | func completeLeafValue(returnType Leaf, result interface{}) interface{} {
  function completeListValue (line 878) | func completeListValue(eCtx *executionContext, returnType *List, fieldAS...
  function defaultResolveTypeFn (line 910) | func defaultResolveTypeFn(p ResolveTypeParams, abstractType Abstract) *O...
  type FieldResolver (line 929) | type FieldResolver interface
  function DefaultResolveFn (line 938) | func DefaultResolveFn(p ResolveParams) (interface{}, error) {
  function getFieldDef (line 1023) | func getFieldDef(schema Schema, parentType *Object, fieldName string) *F...
  type orderedField (line 1044) | type orderedField struct
  function orderedFields (line 1050) | func orderedFields(fields map[string][]*ast.Field) []*orderedField {

FILE: executor_resolve_test.go
  function testSchema (line 11) | func testSchema(t *testing.T, testField *graphql.Field) graphql.Schema {
  function TestExecutesResolveFunction_DefaultFunctionAccessesProperties (line 26) | func TestExecutesResolveFunction_DefaultFunctionAccessesProperties(t *te...
  function TestExecutesResolveFunction_DefaultFunctionCallsMethods (line 47) | func TestExecutesResolveFunction_DefaultFunctionCallsMethods(t *testing....
  function TestExecutesResolveFunction_UsesProvidedResolveFunction (line 70) | func TestExecutesResolveFunction_UsesProvidedResolveFunction(t *testing....
  function TestExecutesResolveFunction_UsesProvidedResolveFunction_SourceIsStruct_WithoutJSONTags (line 117) | func TestExecutesResolveFunction_UsesProvidedResolveFunction_SourceIsStr...
  function TestExecutesResolveFunction_UsesProvidedResolveFunction_SourceIsStruct_WithJSONTags (line 192) | func TestExecutesResolveFunction_UsesProvidedResolveFunction_SourceIsStr...

FILE: executor_schema_test.go
  type testPic (line 17) | type testPic struct
  type testPicFn (line 23) | type testPicFn
  type testAuthor (line 25) | type testAuthor struct
  type testArticle (line 31) | type testArticle struct
  function getPic (line 41) | func getPic(id int, width, height string) *testPic {
  function article (line 51) | func article(id interface{}) *testArticle {
  function TestExecutesUsingAComplexSchema (line 65) | func TestExecutesUsingAComplexSchema(t *testing.T) {

FILE: executor_test.go
  function TestExecutesArbitraryCode (line 18) | func TestExecutesArbitraryCode(t *testing.T) {
  function TestMergesParallelFragments (line 213) | func TestMergesParallelFragments(t *testing.T) {
  type CustomMap (line 300) | type CustomMap
  function TestCustomMapType (line 302) | func TestCustomMapType(t *testing.T) {
  function TestThreadsSourceCorrectly (line 356) | func TestThreadsSourceCorrectly(t *testing.T) {
  function TestCorrectlyThreadsArguments (line 406) | func TestCorrectlyThreadsArguments(t *testing.T) {
  function TestThreadsRootValueContextCorrectly (line 465) | func TestThreadsRootValueContextCorrectly(t *testing.T) {
  function TestThreadsContextCorrectly (line 515) | func TestThreadsContextCorrectly(t *testing.T) {
  function TestNullsOutErrorSubtrees (line 562) | func TestNullsOutErrorSubtrees(t *testing.T) {
  function TestUsesTheInlineOperationIfNoOperationNameIsProvided (line 630) | func TestUsesTheInlineOperationIfNoOperationNameIsProvided(t *testing.T) {
  function TestUsesTheOnlyOperationIfNoOperationNameIsProvided (line 675) | func TestUsesTheOnlyOperationIfNoOperationNameIsProvided(t *testing.T) {
  function TestUsesTheNamedOperationIfOperationNameIsProvided (line 720) | func TestUsesTheNamedOperationIfOperationNameIsProvided(t *testing.T) {
  function TestThrowsIfNoOperationIsProvided (line 765) | func TestThrowsIfNoOperationIsProvided(t *testing.T) {
  function TestThrowsIfNoOperationNameIsProvidedWithMultipleOperations (line 810) | func TestThrowsIfNoOperationNameIsProvidedWithMultipleOperations(t *test...
  function TestThrowsIfUnknownOperationNameIsProvided (line 856) | func TestThrowsIfUnknownOperationNameIsProvided(t *testing.T) {
  function TestThrowsIfOperationTypeIsUnsupported (line 903) | func TestThrowsIfOperationTypeIsUnsupported(t *testing.T) {
  function TestUsesTheQuerySchemaForQueries (line 953) | func TestUsesTheQuerySchemaForQueries(t *testing.T) {
  function TestUsesTheMutationSchemaForMutations (line 1016) | func TestUsesTheMutationSchemaForMutations(t *testing.T) {
  function TestUsesTheSubscriptionSchemaForSubscriptions (line 1071) | func TestUsesTheSubscriptionSchemaForSubscriptions(t *testing.T) {
  function TestCorrectFieldOrderingDespiteExecutionOrder (line 1126) | func TestCorrectFieldOrderingDespiteExecutionOrder(t *testing.T) {
  function TestAvoidsRecursion (line 1209) | func TestAvoidsRecursion(t *testing.T) {
  function TestDoesNotIncludeIllegalFieldsInOutput (line 1267) | func TestDoesNotIncludeIllegalFieldsInOutput(t *testing.T) {
  function TestDoesNotIncludeArgumentsThatWereNotSet (line 1316) | func TestDoesNotIncludeArgumentsThatWereNotSet(t *testing.T) {
  type testSpecialType (line 1378) | type testSpecialType struct
  type testNotSpecialType (line 1381) | type testNotSpecialType struct
  function TestFailsWhenAnIsTypeOfCheckIsNotMet (line 1385) | func TestFailsWhenAnIsTypeOfCheckIsNotMet(t *testing.T) {
  function TestFailsToExecuteQueryContainingATypeDefinition (line 1470) | func TestFailsToExecuteQueryContainingATypeDefinition(t *testing.T) {
  function TestQuery_ExecutionAddsErrorsFromFieldResolveFn (line 1515) | func TestQuery_ExecutionAddsErrorsFromFieldResolveFn(t *testing.T) {
  function TestQuery_ExecutionDoesNotAddErrorsFromFieldResolveFn (line 1553) | func TestQuery_ExecutionDoesNotAddErrorsFromFieldResolveFn(t *testing.T) {
  function TestQuery_InputObjectUsesFieldDefaultValueFn (line 1588) | func TestQuery_InputObjectUsesFieldDefaultValueFn(t *testing.T) {
  function TestMutation_ExecutionAddsErrorsFromFieldResolveFn (line 1638) | func TestMutation_ExecutionAddsErrorsFromFieldResolveFn(t *testing.T) {
  function TestMutation_ExecutionDoesNotAddErrorsFromFieldResolveFn (line 1695) | func TestMutation_ExecutionDoesNotAddErrorsFromFieldResolveFn(t *testing...
  function TestGraphqlTag (line 1749) | func TestGraphqlTag(t *testing.T) {
  function TestFieldResolver (line 1796) | func TestFieldResolver(t *testing.T) {
  type testCustomResolver (line 1851) | type testCustomResolver struct
    method Resolve (line 1853) | func (r testCustomResolver) Resolve(p graphql.ResolveParams) (interfac...
  function TestContextDeadline (line 1860) | func TestContextDeadline(t *testing.T) {
  function TestThunkResultsProcessedCorrectly (line 1913) | func TestThunkResultsProcessedCorrectly(t *testing.T) {
  function TestThunkErrorsAreHandledCorrectly (line 2000) | func TestThunkErrorsAreHandledCorrectly(t *testing.T) {
  function assertJSON (line 2105) | func assertJSON(t *testing.T, expected string, actual interface{}) {
  type extendedError (line 2127) | type extendedError struct
    method Extensions (line 2132) | func (err extendedError) Extensions() map[string]interface{} {
  function testErrors (line 2138) | func testErrors(t *testing.T, nameType graphql.Output, extensions map[st...
  function TestQuery_ErrorPath (line 2230) | func TestQuery_ErrorPath(t *testing.T) {
  function TestQuery_ErrorPathForNonNullField (line 2264) | func TestQuery_ErrorPathForNonNullField(t *testing.T) {
  function TestQuery_ErrorExtensions (line 2295) | func TestQuery_ErrorExtensions(t *testing.T) {
  function TestQuery_OriginalErrorBuiltin (line 2331) | func TestQuery_OriginalErrorBuiltin(t *testing.T) {
  function TestQuery_OriginalErrorExtended (line 2345) | func TestQuery_OriginalErrorExtended(t *testing.T) {
  type customError (line 2362) | type customError struct
    method Error (line 2366) | func (e customError) Error() string {
  function TestQuery_OriginalErrorCustom (line 2370) | func TestQuery_OriginalErrorCustom(t *testing.T) {
  function TestQuery_OriginalErrorCustomPtr (line 2386) | func TestQuery_OriginalErrorCustomPtr(t *testing.T) {
  function TestQuery_OriginalErrorPanic (line 2402) | func TestQuery_OriginalErrorPanic(t *testing.T) {

FILE: extensions.go
  type ParseFinishFunc (line 12) | type ParseFinishFunc
  type parseFinishFuncHandler (line 14) | type parseFinishFuncHandler
  type ValidationFinishFunc (line 17) | type ValidationFinishFunc
  type validationFinishFuncHandler (line 19) | type validationFinishFuncHandler
  type ExecutionFinishFunc (line 22) | type ExecutionFinishFunc
  type executionFinishFuncHandler (line 24) | type executionFinishFuncHandler
  type ResolveFieldFinishFunc (line 27) | type ResolveFieldFinishFunc
  type resolveFieldFinishFuncHandler (line 29) | type resolveFieldFinishFuncHandler
  type Extension (line 33) | type Extension interface
  function handleExtensionsInits (line 60) | func handleExtensionsInits(p *Params) gqlerrors.FormattedErrors {
  function handleExtensionsParseDidStart (line 78) | func handleExtensionsParseDidStart(p *Params) ([]gqlerrors.FormattedErro...
  function handleExtensionsValidationDidStart (line 117) | func handleExtensionsValidationDidStart(p *Params) ([]gqlerrors.Formatte...
  function handleExtensionsExecutionDidStart (line 156) | func handleExtensionsExecutionDidStart(p *ExecuteParams) ([]gqlerrors.Fo...
  function handleExtensionsResolveFieldDidStart (line 195) | func handleExtensionsResolveFieldDidStart(exts []Extension, p *execution...
  function addExtensionResults (line 233) | func addExtensionResults(p *ExecuteParams, result *Result) {

FILE: extensions_test.go
  function tinit (line 15) | func tinit(t *testing.T) graphql.Schema {
  function TestExtensionInitPanic (line 41) | func TestExtensionInitPanic(t *testing.T) {
  function TestExtensionParseDidStartPanic (line 70) | func TestExtensionParseDidStartPanic(t *testing.T) {
  function TestExtensionParseFinishFuncPanic (line 101) | func TestExtensionParseFinishFuncPanic(t *testing.T) {
  function TestExtensionValidationDidStartPanic (line 129) | func TestExtensionValidationDidStartPanic(t *testing.T) {
  function TestExtensionValidationFinishFuncPanic (line 160) | func TestExtensionValidationFinishFuncPanic(t *testing.T) {
  function TestExtensionExecutionDidStartPanic (line 188) | func TestExtensionExecutionDidStartPanic(t *testing.T) {
  function TestExtensionExecutionFinishFuncPanic (line 219) | func TestExtensionExecutionFinishFuncPanic(t *testing.T) {
  function TestExtensionResolveFieldDidStartPanic (line 250) | func TestExtensionResolveFieldDidStartPanic(t *testing.T) {
  function TestExtensionResolveFieldFinishFuncPanic (line 284) | func TestExtensionResolveFieldFinishFuncPanic(t *testing.T) {
  function TestExtensionResolveFieldFinishFuncAfterError (line 315) | func TestExtensionResolveFieldFinishFuncAfterError(t *testing.T) {
  function TestExtensionGetResultPanic (line 344) | func TestExtensionGetResultPanic(t *testing.T) {
  function newtestExt (line 380) | func newtestExt(name string) *testExt {
  type testExt (line 430) | type testExt struct
    method Init (line 441) | func (t *testExt) Init(ctx context.Context, p *graphql.Params) context...
    method Name (line 445) | func (t *testExt) Name() string {
    method HasResult (line 449) | func (t *testExt) HasResult() bool {
    method GetResult (line 453) | func (t *testExt) GetResult(ctx context.Context) interface{} {
    method ParseDidStart (line 457) | func (t *testExt) ParseDidStart(ctx context.Context) (context.Context,...
    method ValidationDidStart (line 461) | func (t *testExt) ValidationDidStart(ctx context.Context) (context.Con...
    method ExecutionDidStart (line 465) | func (t *testExt) ExecutionDidStart(ctx context.Context) (context.Cont...
    method ResolveFieldDidStart (line 469) | func (t *testExt) ResolveFieldDidStart(ctx context.Context, i *graphql...

FILE: gqlerrors/error.go
  type Error (line 12) | type Error struct
    method Error (line 24) | func (g Error) Error() string {
  function NewError (line 28) | func NewError(message string, nodes []ast.Node, stack string, source *so...
  function NewErrorWithPath (line 32) | func NewErrorWithPath(message string, nodes []ast.Node, stack string, so...
  function newError (line 36) | func newError(message string, nodes []ast.Node, stack string, source *so...

FILE: gqlerrors/formatted.go
  type ExtendedError (line 9) | type ExtendedError interface
  type FormattedError (line 14) | type FormattedError struct
    method OriginalError (line 22) | func (g FormattedError) OriginalError() error {
    method Error (line 26) | func (g FormattedError) Error() string {
  function NewFormattedError (line 30) | func NewFormattedError(message string) FormattedError {
  function FormatError (line 35) | func FormatError(err error) FormattedError {
  function FormatErrors (line 63) | func FormatErrors(errs ...error) []FormattedError {

FILE: gqlerrors/located.go
  function NewLocatedError (line 11) | func NewLocatedError(err interface{}, nodes []ast.Node) *Error {
  function FieldASTsToNodeASTs (line 33) | func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node {

FILE: gqlerrors/sortutil.go
  type FormattedErrors (line 5) | type FormattedErrors
    method Len (line 7) | func (errs FormattedErrors) Len() int {
    method Swap (line 11) | func (errs FormattedErrors) Swap(i, j int) {
    method Less (line 15) | func (errs FormattedErrors) Less(i, j int) bool {

FILE: gqlerrors/syntax.go
  function NewSyntaxError (line 13) | func NewSyntaxError(s *source.Source, position int, description string) ...
  function printCharCode (line 26) | func printCharCode(code rune) string {
  function printLine (line 34) | func printLine(str string) string {
  function highlightSourceAtLocation (line 41) | func highlightSourceAtLocation(s *source.Source, l location.SourceLocati...
  function lpad (line 63) | func lpad(l int, s string) string {

FILE: graphql.go
  type Params (line 11) | type Params struct
  function Do (line 36) | func Do(p Params) *Result {

FILE: graphql_bench_test.go
  type B (line 10) | type B struct
  function benchGraphql (line 15) | func benchGraphql(bench B, p graphql.Params, t testing.TB) {
  function BenchmarkListQuery_1 (line 23) | func BenchmarkListQuery_1(b *testing.B) {
  function BenchmarkListQuery_100 (line 27) | func BenchmarkListQuery_100(b *testing.B) {
  function BenchmarkListQuery_1K (line 31) | func BenchmarkListQuery_1K(b *testing.B) {
  function BenchmarkListQuery_10K (line 35) | func BenchmarkListQuery_10K(b *testing.B) {
  function BenchmarkListQuery_100K (line 39) | func BenchmarkListQuery_100K(b *testing.B) {
  function nItemsListQueryBenchmark (line 43) | func nItemsListQueryBenchmark(x int) func(b *testing.B) {
  function BenchmarkWideQuery_1_1 (line 72) | func BenchmarkWideQuery_1_1(b *testing.B) {
  function BenchmarkWideQuery_10_1 (line 76) | func BenchmarkWideQuery_10_1(b *testing.B) {
  function BenchmarkWideQuery_100_1 (line 80) | func BenchmarkWideQuery_100_1(b *testing.B) {
  function BenchmarkWideQuery_1K_1 (line 84) | func BenchmarkWideQuery_1K_1(b *testing.B) {
  function BenchmarkWideQuery_1_10 (line 88) | func BenchmarkWideQuery_1_10(b *testing.B) {
  function BenchmarkWideQuery_10_10 (line 92) | func BenchmarkWideQuery_10_10(b *testing.B) {
  function BenchmarkWideQuery_100_10 (line 96) | func BenchmarkWideQuery_100_10(b *testing.B) {
  function BenchmarkWideQuery_1K_10 (line 100) | func BenchmarkWideQuery_1K_10(b *testing.B) {
  function nFieldsyItemsQueryBenchmark (line 104) | func nFieldsyItemsQueryBenchmark(x int, y int) func(b *testing.B) {

FILE: graphql_test.go
  type T (line 12) | type T struct
  function init (line 21) | func init() {
  function TestQuery (line 96) | func TestQuery(t *testing.T) {
  function testGraphql (line 107) | func testGraphql(test T, p graphql.Params, t *testing.T) {
  function TestBasicGraphQLExample (line 117) | func TestBasicGraphQLExample(t *testing.T) {
  function TestThreadsContextFromParamsThrough (line 158) | func TestThreadsContextFromParamsThrough(t *testing.T) {
  function TestNewErrorChecksNilNodes (line 197) | func TestNewErrorChecksNilNodes(t *testing.T) {
  function TestEmptyStringIsNotNull (line 224) | func TestEmptyStringIsNotNull(t *testing.T) {

FILE: introspection.go
  constant TypeKindScalar (line 13) | TypeKindScalar      = "SCALAR"
  constant TypeKindObject (line 14) | TypeKindObject      = "OBJECT"
  constant TypeKindInterface (line 15) | TypeKindInterface   = "INTERFACE"
  constant TypeKindUnion (line 16) | TypeKindUnion       = "UNION"
  constant TypeKindEnum (line 17) | TypeKindEnum        = "ENUM"
  constant TypeKindInputObject (line 18) | TypeKindInputObject = "INPUT_OBJECT"
  constant TypeKindList (line 19) | TypeKindList        = "LIST"
  constant TypeKindNonNull (line 20) | TypeKindNonNull     = "NON_NULL"
  function init (line 58) | func init() {
  function astFromValue (line 692) | func astFromValue(value interface{}, ttype Type) ast.Value {

FILE: introspection_test.go
  function g (line 12) | func g(t *testing.T, p graphql.Params) *graphql.Result {
  function TestIntrospection_ExecutesAnIntrospectionQuery (line 16) | func TestIntrospection_ExecutesAnIntrospectionQuery(t *testing.T) {
  function TestIntrospection_ExecutesAnInputObject (line 836) | func TestIntrospection_ExecutesAnInputObject(t *testing.T) {
  function TestIntrospection_SupportsThe__TypeRootField (line 948) | func TestIntrospection_SupportsThe__TypeRootField(t *testing.T) {
  function TestIntrospection_IdentifiesDeprecatedFields (line 986) | func TestIntrospection_IdentifiesDeprecatedFields(t *testing.T) {
  function TestIntrospection_RespectsTheIncludeDeprecatedParameterForFields (line 1045) | func TestIntrospection_RespectsTheIncludeDeprecatedParameterForFields(t ...
  function TestIntrospection_IdentifiesDeprecatedEnumValues (line 1114) | func TestIntrospection_IdentifiesDeprecatedEnumValues(t *testing.T) {
  function TestIntrospection_RespectsTheIncludeDeprecatedParameterForEnumValues (line 1189) | func TestIntrospection_RespectsTheIncludeDeprecatedParameterForEnumValue...
  function TestIntrospection_FailsAsExpectedOnThe__TypeRootFieldWithoutAnArg (line 1278) | func TestIntrospection_FailsAsExpectedOnThe__TypeRootFieldWithoutAnArg(t...
  function TestIntrospection_ExposesDescriptionsOnTypesAndFields (line 1321) | func TestIntrospection_ExposesDescriptionsOnTypesAndFields(t *testing.T) {
  function TestIntrospection_ExposesDescriptionsOnEnums (line 1393) | func TestIntrospection_ExposesDescriptionsOnEnums(t *testing.T) {

FILE: language/ast/arguments.go
  type Argument (line 8) | type Argument struct
    method GetKind (line 23) | func (arg *Argument) GetKind() string {
    method GetLoc (line 27) | func (arg *Argument) GetLoc() *Location {
  function NewArgument (line 15) | func NewArgument(arg *Argument) *Argument {

FILE: language/ast/definitions.go
  type Definition (line 7) | type Definition interface
  constant OperationTypeQuery (line 22) | OperationTypeQuery        = "query"
  constant OperationTypeMutation (line 23) | OperationTypeMutation     = "mutation"
  constant OperationTypeSubscription (line 24) | OperationTypeSubscription = "subscription"
  type OperationDefinition (line 28) | type OperationDefinition struct
    method GetKind (line 46) | func (op *OperationDefinition) GetKind() string {
    method GetLoc (line 50) | func (op *OperationDefinition) GetLoc() *Location {
    method GetOperation (line 54) | func (op *OperationDefinition) GetOperation() string {
    method GetName (line 58) | func (op *OperationDefinition) GetName() *Name {
    method GetVariableDefinitions (line 62) | func (op *OperationDefinition) GetVariableDefinitions() []*VariableDef...
    method GetDirectives (line 66) | func (op *OperationDefinition) GetDirectives() []*Directive {
    method GetSelectionSet (line 70) | func (op *OperationDefinition) GetSelectionSet() *SelectionSet {
  function NewOperationDefinition (line 38) | func NewOperationDefinition(op *OperationDefinition) *OperationDefinition {
  type FragmentDefinition (line 75) | type FragmentDefinition struct
    method GetKind (line 102) | func (fd *FragmentDefinition) GetKind() string {
    method GetLoc (line 106) | func (fd *FragmentDefinition) GetLoc() *Location {
    method GetOperation (line 110) | func (fd *FragmentDefinition) GetOperation() string {
    method GetName (line 114) | func (fd *FragmentDefinition) GetName() *Name {
    method GetVariableDefinitions (line 118) | func (fd *FragmentDefinition) GetVariableDefinitions() []*VariableDefi...
    method GetSelectionSet (line 122) | func (fd *FragmentDefinition) GetSelectionSet() *SelectionSet {
  function NewFragmentDefinition (line 86) | func NewFragmentDefinition(fd *FragmentDefinition) *FragmentDefinition {
  type VariableDefinition (line 127) | type VariableDefinition struct
    method GetKind (line 143) | func (vd *VariableDefinition) GetKind() string {
    method GetLoc (line 147) | func (vd *VariableDefinition) GetLoc() *Location {
  function NewVariableDefinition (line 135) | func NewVariableDefinition(vd *VariableDefinition) *VariableDefinition {
  type TypeExtensionDefinition (line 152) | type TypeExtensionDefinition struct
    method GetKind (line 169) | func (def *TypeExtensionDefinition) GetKind() string {
    method GetLoc (line 173) | func (def *TypeExtensionDefinition) GetLoc() *Location {
    method GetVariableDefinitions (line 177) | func (def *TypeExtensionDefinition) GetVariableDefinitions() []*Variab...
    method GetSelectionSet (line 181) | func (def *TypeExtensionDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 185) | func (def *TypeExtensionDefinition) GetOperation() string {
  function NewTypeExtensionDefinition (line 158) | func NewTypeExtensionDefinition(def *TypeExtensionDefinition) *TypeExten...
  type DirectiveDefinition (line 190) | type DirectiveDefinition struct
    method GetKind (line 213) | func (def *DirectiveDefinition) GetKind() string {
    method GetLoc (line 217) | func (def *DirectiveDefinition) GetLoc() *Location {
    method GetVariableDefinitions (line 221) | func (def *DirectiveDefinition) GetVariableDefinitions() []*VariableDe...
    method GetSelectionSet (line 225) | func (def *DirectiveDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 229) | func (def *DirectiveDefinition) GetOperation() string {
    method GetDescription (line 233) | func (def *DirectiveDefinition) GetDescription() *StringValue {
  function NewDirectiveDefinition (line 199) | func NewDirectiveDefinition(def *DirectiveDefinition) *DirectiveDefiniti...

FILE: language/ast/directives.go
  type Directive (line 8) | type Directive struct
    method GetKind (line 27) | func (dir *Directive) GetKind() string {
    method GetLoc (line 31) | func (dir *Directive) GetLoc() *Location {
  function NewDirective (line 15) | func NewDirective(dir *Directive) *Directive {

FILE: language/ast/document.go
  type Document (line 8) | type Document struct
    method GetKind (line 25) | func (node *Document) GetKind() string {
    method GetLoc (line 29) | func (node *Document) GetLoc() *Location {
  function NewDocument (line 14) | func NewDocument(d *Document) *Document {

FILE: language/ast/location.go
  type Location (line 7) | type Location struct
  function NewLocation (line 13) | func NewLocation(loc *Location) *Location {

FILE: language/ast/name.go
  type Name (line 8) | type Name struct
    method GetKind (line 22) | func (node *Name) GetKind() string {
    method GetLoc (line 26) | func (node *Name) GetLoc() *Location {
  function NewName (line 14) | func NewName(node *Name) *Name {

FILE: language/ast/node.go
  type Node (line 3) | type Node interface

FILE: language/ast/selections.go
  type Selection (line 7) | type Selection interface
  type Field (line 17) | type Field struct
    method GetKind (line 35) | func (f *Field) GetKind() string {
    method GetLoc (line 39) | func (f *Field) GetLoc() *Location {
    method GetSelectionSet (line 43) | func (f *Field) GetSelectionSet() *SelectionSet {
  function NewField (line 27) | func NewField(f *Field) *Field {
  type FragmentSpread (line 48) | type FragmentSpread struct
    method GetKind (line 67) | func (fs *FragmentSpread) GetKind() string {
    method GetLoc (line 71) | func (fs *FragmentSpread) GetLoc() *Location {
    method GetSelectionSet (line 75) | func (fs *FragmentSpread) GetSelectionSet() *SelectionSet {
  function NewFragmentSpread (line 55) | func NewFragmentSpread(fs *FragmentSpread) *FragmentSpread {
  type InlineFragment (line 80) | type InlineFragment struct
    method GetKind (line 101) | func (f *InlineFragment) GetKind() string {
    method GetLoc (line 105) | func (f *InlineFragment) GetLoc() *Location {
    method GetSelectionSet (line 109) | func (f *InlineFragment) GetSelectionSet() *SelectionSet {
  function NewInlineFragment (line 88) | func NewInlineFragment(f *InlineFragment) *InlineFragment {
  type SelectionSet (line 114) | type SelectionSet struct
    method GetKind (line 128) | func (ss *SelectionSet) GetKind() string {
    method GetLoc (line 132) | func (ss *SelectionSet) GetLoc() *Location {
  function NewSelectionSet (line 120) | func NewSelectionSet(ss *SelectionSet) *SelectionSet {

FILE: language/ast/type_definitions.go
  type DescribableNode (line 8) | type DescribableNode interface
  type TypeDefinition (line 12) | type TypeDefinition interface
  type TypeSystemDefinition (line 28) | type TypeSystemDefinition interface
  type SchemaDefinition (line 42) | type SchemaDefinition struct
    method GetKind (line 61) | func (def *SchemaDefinition) GetKind() string {
    method GetLoc (line 65) | func (def *SchemaDefinition) GetLoc() *Location {
    method GetVariableDefinitions (line 69) | func (def *SchemaDefinition) GetVariableDefinitions() []*VariableDefin...
    method GetSelectionSet (line 73) | func (def *SchemaDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 77) | func (def *SchemaDefinition) GetOperation() string {
  function NewSchemaDefinition (line 49) | func NewSchemaDefinition(def *SchemaDefinition) *SchemaDefinition {
  type OperationTypeDefinition (line 82) | type OperationTypeDefinition struct
    method GetKind (line 101) | func (def *OperationTypeDefinition) GetKind() string {
    method GetLoc (line 105) | func (def *OperationTypeDefinition) GetLoc() *Location {
  function NewOperationTypeDefinition (line 89) | func NewOperationTypeDefinition(def *OperationTypeDefinition) *Operation...
  type ScalarDefinition (line 110) | type ScalarDefinition struct
    method GetKind (line 131) | func (def *ScalarDefinition) GetKind() string {
    method GetLoc (line 135) | func (def *ScalarDefinition) GetLoc() *Location {
    method GetName (line 139) | func (def *ScalarDefinition) GetName() *Name {
    method GetVariableDefinitions (line 143) | func (def *ScalarDefinition) GetVariableDefinitions() []*VariableDefin...
    method GetSelectionSet (line 147) | func (def *ScalarDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 151) | func (def *ScalarDefinition) GetOperation() string {
    method GetDescription (line 155) | func (def *ScalarDefinition) GetDescription() *StringValue {
  function NewScalarDefinition (line 118) | func NewScalarDefinition(def *ScalarDefinition) *ScalarDefinition {
  type ObjectDefinition (line 160) | type ObjectDefinition struct
    method GetKind (line 185) | func (def *ObjectDefinition) GetKind() string {
    method GetLoc (line 189) | func (def *ObjectDefinition) GetLoc() *Location {
    method GetName (line 193) | func (def *ObjectDefinition) GetName() *Name {
    method GetVariableDefinitions (line 197) | func (def *ObjectDefinition) GetVariableDefinitions() []*VariableDefin...
    method GetSelectionSet (line 201) | func (def *ObjectDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 205) | func (def *ObjectDefinition) GetOperation() string {
    method GetDescription (line 209) | func (def *ObjectDefinition) GetDescription() *StringValue {
  function NewObjectDefinition (line 170) | func NewObjectDefinition(def *ObjectDefinition) *ObjectDefinition {
  type FieldDefinition (line 214) | type FieldDefinition struct
    method GetKind (line 239) | func (def *FieldDefinition) GetKind() string {
    method GetLoc (line 243) | func (def *FieldDefinition) GetLoc() *Location {
    method GetDescription (line 247) | func (def *FieldDefinition) GetDescription() *StringValue {
  function NewFieldDefinition (line 224) | func NewFieldDefinition(def *FieldDefinition) *FieldDefinition {
  type InputValueDefinition (line 252) | type InputValueDefinition struct
    method GetKind (line 277) | func (def *InputValueDefinition) GetKind() string {
    method GetLoc (line 281) | func (def *InputValueDefinition) GetLoc() *Location {
    method GetDescription (line 285) | func (def *InputValueDefinition) GetDescription() *StringValue {
  function NewInputValueDefinition (line 262) | func NewInputValueDefinition(def *InputValueDefinition) *InputValueDefin...
  type InterfaceDefinition (line 290) | type InterfaceDefinition struct
    method GetKind (line 313) | func (def *InterfaceDefinition) GetKind() string {
    method GetLoc (line 317) | func (def *InterfaceDefinition) GetLoc() *Location {
    method GetName (line 321) | func (def *InterfaceDefinition) GetName() *Name {
    method GetVariableDefinitions (line 325) | func (def *InterfaceDefinition) GetVariableDefinitions() []*VariableDe...
    method GetSelectionSet (line 329) | func (def *InterfaceDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 333) | func (def *InterfaceDefinition) GetOperation() string {
    method GetDescription (line 337) | func (def *InterfaceDefinition) GetDescription() *StringValue {
  function NewInterfaceDefinition (line 299) | func NewInterfaceDefinition(def *InterfaceDefinition) *InterfaceDefiniti...
  type UnionDefinition (line 342) | type UnionDefinition struct
    method GetKind (line 365) | func (def *UnionDefinition) GetKind() string {
    method GetLoc (line 369) | func (def *UnionDefinition) GetLoc() *Location {
    method GetName (line 373) | func (def *UnionDefinition) GetName() *Name {
    method GetVariableDefinitions (line 377) | func (def *UnionDefinition) GetVariableDefinitions() []*VariableDefini...
    method GetSelectionSet (line 381) | func (def *UnionDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 385) | func (def *UnionDefinition) GetOperation() string {
    method GetDescription (line 389) | func (def *UnionDefinition) GetDescription() *StringValue {
  function NewUnionDefinition (line 351) | func NewUnionDefinition(def *UnionDefinition) *UnionDefinition {
  type EnumDefinition (line 394) | type EnumDefinition struct
    method GetKind (line 417) | func (def *EnumDefinition) GetKind() string {
    method GetLoc (line 421) | func (def *EnumDefinition) GetLoc() *Location {
    method GetName (line 425) | func (def *EnumDefinition) GetName() *Name {
    method GetVariableDefinitions (line 429) | func (def *EnumDefinition) GetVariableDefinitions() []*VariableDefinit...
    method GetSelectionSet (line 433) | func (def *EnumDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 437) | func (def *EnumDefinition) GetOperation() string {
    method GetDescription (line 441) | func (def *EnumDefinition) GetDescription() *StringValue {
  function NewEnumDefinition (line 403) | func NewEnumDefinition(def *EnumDefinition) *EnumDefinition {
  type EnumValueDefinition (line 446) | type EnumValueDefinition struct
    method GetKind (line 467) | func (def *EnumValueDefinition) GetKind() string {
    method GetLoc (line 471) | func (def *EnumValueDefinition) GetLoc() *Location {
    method GetDescription (line 475) | func (def *EnumValueDefinition) GetDescription() *StringValue {
  function NewEnumValueDefinition (line 454) | func NewEnumValueDefinition(def *EnumValueDefinition) *EnumValueDefiniti...
  type InputObjectDefinition (line 480) | type InputObjectDefinition struct
    method GetKind (line 503) | func (def *InputObjectDefinition) GetKind() string {
    method GetLoc (line 507) | func (def *InputObjectDefinition) GetLoc() *Location {
    method GetName (line 511) | func (def *InputObjectDefinition) GetName() *Name {
    method GetVariableDefinitions (line 515) | func (def *InputObjectDefinition) GetVariableDefinitions() []*Variable...
    method GetSelectionSet (line 519) | func (def *InputObjectDefinition) GetSelectionSet() *SelectionSet {
    method GetOperation (line 523) | func (def *InputObjectDefinition) GetOperation() string {
    method GetDescription (line 527) | func (def *InputObjectDefinition) GetDescription() *StringValue {
  function NewInputObjectDefinition (line 489) | func NewInputObjectDefinition(def *InputObjectDefinition) *InputObjectDe...

FILE: language/ast/types.go
  type Type (line 7) | type Type interface
  type Named (line 19) | type Named struct
    method GetKind (line 33) | func (t *Named) GetKind() string {
    method GetLoc (line 37) | func (t *Named) GetLoc() *Location {
    method String (line 41) | func (t *Named) String() string {
  function NewNamed (line 25) | func NewNamed(t *Named) *Named {
  type List (line 46) | type List struct
    method GetKind (line 63) | func (t *List) GetKind() string {
    method GetLoc (line 67) | func (t *List) GetLoc() *Location {
    method String (line 71) | func (t *List) String() string {
  function NewList (line 52) | func NewList(t *List) *List {
  type NonNull (line 76) | type NonNull struct
    method GetKind (line 93) | func (t *NonNull) GetKind() string {
    method GetLoc (line 97) | func (t *NonNull) GetLoc() *Location {
    method String (line 101) | func (t *NonNull) String() string {
  function NewNonNull (line 82) | func NewNonNull(t *NonNull) *NonNull {

FILE: language/ast/values.go
  type Value (line 7) | type Value interface
  type Variable (line 24) | type Variable struct
    method GetKind (line 38) | func (v *Variable) GetKind() string {
    method GetLoc (line 42) | func (v *Variable) GetLoc() *Location {
    method GetValue (line 47) | func (v *Variable) GetValue() interface{} {
    method GetName (line 51) | func (v *Variable) GetName() interface{} {
  function NewVariable (line 30) | func NewVariable(v *Variable) *Variable {
  type IntValue (line 56) | type IntValue struct
    method GetKind (line 73) | func (v *IntValue) GetKind() string {
    method GetLoc (line 77) | func (v *IntValue) GetLoc() *Location {
    method GetValue (line 81) | func (v *IntValue) GetValue() interface{} {
  function NewIntValue (line 62) | func NewIntValue(v *IntValue) *IntValue {
  type FloatValue (line 86) | type FloatValue struct
    method GetKind (line 103) | func (v *FloatValue) GetKind() string {
    method GetLoc (line 107) | func (v *FloatValue) GetLoc() *Location {
    method GetValue (line 111) | func (v *FloatValue) GetValue() interface{} {
  function NewFloatValue (line 92) | func NewFloatValue(v *FloatValue) *FloatValue {
  type StringValue (line 116) | type StringValue struct
    method GetKind (line 133) | func (v *StringValue) GetKind() string {
    method GetLoc (line 137) | func (v *StringValue) GetLoc() *Location {
    method GetValue (line 141) | func (v *StringValue) GetValue() interface{} {
  function NewStringValue (line 122) | func NewStringValue(v *StringValue) *StringValue {
  type BooleanValue (line 146) | type BooleanValue struct
    method GetKind (line 163) | func (v *BooleanValue) GetKind() string {
    method GetLoc (line 167) | func (v *BooleanValue) GetLoc() *Location {
    method GetValue (line 171) | func (v *BooleanValue) GetValue() interface{} {
  function NewBooleanValue (line 152) | func NewBooleanValue(v *BooleanValue) *BooleanValue {
  type EnumValue (line 176) | type EnumValue struct
    method GetKind (line 193) | func (v *EnumValue) GetKind() string {
    method GetLoc (line 197) | func (v *EnumValue) GetLoc() *Location {
    method GetValue (line 201) | func (v *EnumValue) GetValue() interface{} {
  function NewEnumValue (line 182) | func NewEnumValue(v *EnumValue) *EnumValue {
  type ListValue (line 206) | type ListValue struct
    method GetKind (line 223) | func (v *ListValue) GetKind() string {
    method GetLoc (line 227) | func (v *ListValue) GetLoc() *Location {
    method GetValue (line 232) | func (v *ListValue) GetValue() interface{} {
    method GetValues (line 236) | func (v *ListValue) GetValues() interface{} {
  function NewListValue (line 212) | func NewListValue(v *ListValue) *ListValue {
  type ObjectValue (line 242) | type ObjectValue struct
    method GetKind (line 259) | func (v *ObjectValue) GetKind() string {
    method GetLoc (line 263) | func (v *ObjectValue) GetLoc() *Location {
    method GetValue (line 267) | func (v *ObjectValue) GetValue() interface{} {
  function NewObjectValue (line 248) | func NewObjectValue(v *ObjectValue) *ObjectValue {
  type ObjectField (line 273) | type ObjectField struct
    method GetKind (line 292) | func (f *ObjectField) GetKind() string {
    method GetLoc (line 296) | func (f *ObjectField) GetLoc() *Location {
    method GetValue (line 300) | func (f *ObjectField) GetValue() interface{} {
  function NewObjectField (line 280) | func NewObjectField(f *ObjectField) *ObjectField {

FILE: language/kinds/kinds.go
  constant Name (line 5) | Name = "Name"
  constant Document (line 8) | Document            = "Document"
  constant OperationDefinition (line 9) | OperationDefinition = "OperationDefinition"
  constant VariableDefinition (line 10) | VariableDefinition  = "VariableDefinition"
  constant Variable (line 11) | Variable            = "Variable"
  constant SelectionSet (line 12) | SelectionSet        = "SelectionSet"
  constant Field (line 13) | Field               = "Field"
  constant Argument (line 14) | Argument            = "Argument"
  constant FragmentSpread (line 17) | FragmentSpread     = "FragmentSpread"
  constant InlineFragment (line 18) | InlineFragment     = "InlineFragment"
  constant FragmentDefinition (line 19) | FragmentDefinition = "FragmentDefinition"
  constant IntValue (line 22) | IntValue     = "IntValue"
  constant FloatValue (line 23) | FloatValue   = "FloatValue"
  constant StringValue (line 24) | StringValue  = "StringValue"
  constant BooleanValue (line 25) | BooleanValue = "BooleanValue"
  constant EnumValue (line 26) | EnumValue    = "EnumValue"
  constant ListValue (line 27) | ListValue    = "ListValue"
  constant ObjectValue (line 28) | ObjectValue  = "ObjectValue"
  constant ObjectField (line 29) | ObjectField  = "ObjectField"
  constant Directive (line 32) | Directive = "Directive"
  constant Named (line 35) | Named   = "Named"
  constant List (line 36) | List    = "List"
  constant NonNull (line 37) | NonNull = "NonNull"
  constant SchemaDefinition (line 40) | SchemaDefinition        = "SchemaDefinition"
  constant OperationTypeDefinition (line 41) | OperationTypeDefinition = "OperationTypeDefinition"
  constant ScalarDefinition (line 44) | ScalarDefinition      = "ScalarDefinition"
  constant ObjectDefinition (line 45) | ObjectDefinition      = "ObjectDefinition"
  constant FieldDefinition (line 46) | FieldDefinition       = "FieldDefinition"
  constant InputValueDefinition (line 47) | InputValueDefinition  = "InputValueDefinition"
  constant InterfaceDefinition (line 48) | InterfaceDefinition   = "InterfaceDefinition"
  constant UnionDefinition (line 49) | UnionDefinition       = "UnionDefinition"
  constant EnumDefinition (line 50) | EnumDefinition        = "EnumDefinition"
  constant EnumValueDefinition (line 51) | EnumValueDefinition   = "EnumValueDefinition"
  constant InputObjectDefinition (line 52) | InputObjectDefinition = "InputObjectDefinition"
  constant TypeExtensionDefinition (line 55) | TypeExtensionDefinition = "TypeExtensionDefinition"
  constant DirectiveDefinition (line 58) | DirectiveDefinition = "DirectiveDefinition"

FILE: language/lexer/lexer.go
  type TokenKind (line 14) | type TokenKind
    method String (line 62) | func (kind TokenKind) String() string {
  constant EOF (line 17) | EOF TokenKind = iota + 1
  constant BANG (line 18) | BANG
  constant DOLLAR (line 19) | DOLLAR
  constant PAREN_L (line 20) | PAREN_L
  constant PAREN_R (line 21) | PAREN_R
  constant SPREAD (line 22) | SPREAD
  constant COLON (line 23) | COLON
  constant EQUALS (line 24) | EQUALS
  constant AT (line 25) | AT
  constant BRACKET_L (line 26) | BRACKET_L
  constant BRACKET_R (line 27) | BRACKET_R
  constant BRACE_L (line 28) | BRACE_L
  constant PIPE (line 29) | PIPE
  constant BRACE_R (line 30) | BRACE_R
  constant NAME (line 31) | NAME
  constant INT (line 32) | INT
  constant FLOAT (line 33) | FLOAT
  constant STRING (line 34) | STRING
  constant BLOCK_STRING (line 35) | BLOCK_STRING
  constant AMP (line 36) | AMP
  constant FRAGMENT (line 68) | FRAGMENT     = "fragment"
  constant QUERY (line 69) | QUERY        = "query"
  constant MUTATION (line 70) | MUTATION     = "mutation"
  constant SUBSCRIPTION (line 71) | SUBSCRIPTION = "subscription"
  constant SCHEMA (line 72) | SCHEMA       = "schema"
  constant SCALAR (line 73) | SCALAR       = "scalar"
  constant TYPE (line 74) | TYPE         = "type"
  constant INTERFACE (line 75) | INTERFACE    = "interface"
  constant UNION (line 76) | UNION        = "union"
  constant ENUM (line 77) | ENUM         = "enum"
  constant INPUT (line 78) | INPUT        = "input"
  constant EXTEND (line 79) | EXTEND       = "extend"
  constant DIRECTIVE (line 80) | DIRECTIVE    = "directive"
  type Token (line 85) | type Token struct
  type Lexer (line 92) | type Lexer
  function Lex (line 94) | func Lex(s *source.Source) Lexer {
  function readName (line 113) | func readName(source *source.Source, position, runePosition int) Token {
  function readNumber (line 139) | func readNumber(s *source.Source, start int, firstCode rune, codeLength ...
  function readDigits (line 197) | func readDigits(s *source.Source, start int, firstCode rune, codeLength ...
  function readString (line 218) | func readString(s *source.Source, start int) (Token, error) {
  function readBlockString (line 315) | func readBlockString(s *source.Source, start int) (Token, error) {
  function blockStringValue (line 381) | func blockStringValue(in string) string {
  function leadingWhitespaceLen (line 422) | func leadingWhitespaceLen(in string) (n int) {
  function lineIsBlank (line 434) | func lineIsBlank(in string) bool {
  function uniCharCode (line 444) | func uniCharCode(a, b, c, d rune) rune {
  function char2hex (line 453) | func char2hex(a rune) int {
  function makeToken (line 465) | func makeToken(kind TokenKind, start int, end int, value string) Token {
  function printCharCode (line 469) | func printCharCode(code rune) string {
  function readToken (line 482) | func readToken(s *source.Source, fromPosition int) (Token, error) {
  function runeAt (line 579) | func runeAt(body []byte, position int) (code rune, charWidth int) {
  function positionAfterWhitespace (line 598) | func positionAfterWhitespace(body []byte, startPosition int) (position i...
  function GetTokenDesc (line 645) | func GetTokenDesc(token Token) string {

FILE: language/lexer/lexer_test.go
  type Test (line 10) | type Test struct
  function createSource (line 15) | func createSource(body string) *source.Source {
  function TestLexer_GetTokenDesc (line 19) | func TestLexer_GetTokenDesc(t *testing.T) {
  function TestLexer_DisallowsUncommonControlCharacters (line 66) | func TestLexer_DisallowsUncommonControlCharacters(t *testing.T) {
  function TestLexer_AcceptsBOMHeader (line 88) | func TestLexer_AcceptsBOMHeader(t *testing.T) {
  function TestLexer_SkipsWhiteSpace (line 111) | func TestLexer_SkipsWhiteSpace(t *testing.T) {
  function TestLexer_ErrorsRespectWhitespace (line 168) | func TestLexer_ErrorsRespectWhitespace(t *testing.T) {
  function TestLexer_LexesNames (line 184) | func TestLexer_LexesNames(t *testing.T) {
  function TestLexer_LexesStrings (line 216) | func TestLexer_LexesStrings(t *testing.T) {
  function TestLexer_ReportsUsefulStringErrors (line 311) | func TestLexer_ReportsUsefulStringErrors(t *testing.T) {
  function TestLexer_LexesBlockStrings (line 450) | func TestLexer_LexesBlockStrings(t *testing.T) {
  function TestLexer_ReportsUsefulBlockStringErrors (line 574) | func TestLexer_ReportsUsefulBlockStringErrors(t *testing.T) {
  function TestLexer_LexesNumbers (line 621) | func TestLexer_LexesNumbers(t *testing.T) {
  function TestLexer_ReportsUsefulNumberErrors (line 779) | func TestLexer_ReportsUsefulNumberErrors(t *testing.T) {
  function TestLexer_LexesPunctuation (line 858) | func TestLexer_LexesPunctuation(t *testing.T) {
  function TestLexer_ReportsUsefulUnknownCharacterError (line 989) | func TestLexer_ReportsUsefulUnknownCharacterError(t *testing.T) {
  function TestLexer_ReportsUsefulInformationForDashesInNames (line 1043) | func TestLexer_ReportsUsefulInformationForDashesInNames(t *testing.T) {

FILE: language/location/location.go
  type SourceLocation (line 9) | type SourceLocation struct
  function GetLocation (line 14) | func GetLocation(s *source.Source, position int) SourceLocation {

FILE: language/parser/parser.go
  type parseFn (line 12) | type parseFn
  type parseDefinitionFn (line 15) | type parseDefinitionFn
  function init (line 19) | func init() {
  type ParseOptions (line 38) | type ParseOptions struct
  type ParseParams (line 43) | type ParseParams struct
  type Parser (line 48) | type Parser struct
  function Parse (line 56) | func Parse(p ParseParams) (*ast.Document, error) {
  function ParseValue (line 77) | func ParseValue(p ParseParams) (ast.Value, error) {
  function parseName (line 99) | func parseName(parser *Parser) (*ast.Name, error) {
  function makeParser (line 110) | func makeParser(s *source.Source, opts ParseOptions) (*Parser, error) {
  function parseDocument (line 127) | func parseDocument(parser *Parser) (*ast.Document, error) {
  function parseOperationDefinition (line 167) | func parseOperationDefinition(parser *Parser) (ast.Node, error) {
  function parseOperationType (line 220) | func parseOperationType(parser *Parser) (string, error) {
  function parseVariableDefinitions (line 240) | func parseVariableDefinitions(parser *Parser) ([]*ast.VariableDefinition...
  function parseVariableDefinition (line 261) | func parseVariableDefinition(parser *Parser) (interface{}, error) {
  function parseVariable (line 296) | func parseVariable(parser *Parser) (*ast.Variable, error) {
  function parseSelectionSet (line 317) | func parseSelectionSet(parser *Parser) (*ast.SelectionSet, error) {
  function parseSelection (line 343) | func parseSelection(parser *Parser) (interface{}, error) {
  function parseField (line 355) | func parseField(parser *Parser) (*ast.Field, error) {
  function parseArguments (line 400) | func parseArguments(parser *Parser) ([]*ast.Argument, error) {
  function parseArgument (line 420) | func parseArgument(parser *Parser) (interface{}, error) {
  function parseFragment (line 452) | func parseFragment(parser *Parser) (interface{}, error) {
  function parseFragmentDefinition (line 509) | func parseFragmentDefinition(parser *Parser) (ast.Node, error) {
  function parseFragmentName (line 547) | func parseFragmentName(parser *Parser) (*ast.Name, error) {
  function parseValueLiteral (line 571) | func parseValueLiteral(parser *Parser, isConst bool) (ast.Value, error) {
  function parseConstValue (line 627) | func parseConstValue(parser *Parser) (interface{}, error) {
  function parseValueValue (line 635) | func parseValueValue(parser *Parser) (interface{}, error) {
  function parseList (line 644) | func parseList(parser *Parser, isConst bool) (*ast.ListValue, error) {
  function parseObject (line 672) | func parseObject(parser *Parser, isConst bool) (*ast.ObjectValue, error) {
  function parseObjectField (line 699) | func parseObjectField(parser *Parser, isConst bool) (*ast.ObjectField, e...
  function parseDirectives (line 727) | func parseDirectives(parser *Parser) ([]*ast.Directive, error) {
  function parseDirective (line 742) | func parseDirective(parser *Parser) (*ast.Directive, error) {
  function parseType (line 773) | func parseType(parser *Parser) (ttype ast.Type, err error) {
  function parseNamed (line 814) | func parseNamed(parser *Parser) (*ast.Named, error) {
  function parseTypeSystemDefinition (line 843) | func parseTypeSystemDefinition(parser *Parser) (ast.Node, error) {
  function parseSchemaDefinition (line 871) | func parseSchemaDefinition(parser *Parser) (ast.Node, error) {
  function parseOperationTypeDefinition (line 902) | func parseOperationTypeDefinition(parser *Parser) (interface{}, error) {
  function parseScalarTypeDefinition (line 926) | func parseScalarTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseObjectTypeDefinition (line 958) | func parseObjectTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseImplementsInterfaces (line 1008) | func parseImplementsInterfaces(parser *Parser) ([]*ast.Named, error) {
  function parseFieldDefinition (line 1035) | func parseFieldDefinition(parser *Parser) (interface{}, error) {
  function parseArgumentDefs (line 1074) | func parseArgumentDefs(parser *Parser) ([]*ast.InputValueDefinition, err...
  function parseInputValueDef (line 1098) | func parseInputValueDef(parser *Parser) (interface{}, error) {
  function parseInterfaceTypeDefinition (line 1149) | func parseInterfaceTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseUnionTypeDefinition (line 1192) | func parseUnionTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseUnionMembers (line 1232) | func parseUnionMembers(parser *Parser) ([]*ast.Named, error) {
  function parseEnumTypeDefinition (line 1252) | func parseEnumTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseEnumValueDefinition (line 1297) | func parseEnumValueDefinition(parser *Parser) (interface{}, error) {
  function parseInputObjectTypeDefinition (line 1323) | func parseInputObjectTypeDefinition(parser *Parser) (ast.Node, error) {
  function parseTypeExtensionDefinition (line 1366) | func parseTypeExtensionDefinition(parser *Parser) (ast.Node, error) {
  function parseDirectiveDefinition (line 1387) | func parseDirectiveDefinition(parser *Parser) (ast.Node, error) {
  function parseDirectiveLocations (line 1432) | func parseDirectiveLocations(parser *Parser) ([]*ast.Name, error) {
  function parseStringLiteral (line 1450) | func parseStringLiteral(parser *Parser) (*ast.StringValue, error) {
  function parseDescription (line 1464) | func parseDescription(parser *Parser) (*ast.StringValue, error) {
  function loc (line 1475) | func loc(parser *Parser, start int) *ast.Location {
  function advance (line 1493) | func advance(parser *Parser) error {
  function lookahead (line 1504) | func lookahead(parser *Parser) (lexer.Token, error) {
  function peek (line 1509) | func peek(parser *Parser, Kind lexer.TokenKind) bool {
  function peekDescription (line 1514) | func peekDescription(parser *Parser) bool {
  function skip (line 1520) | func skip(parser *Parser, Kind lexer.TokenKind) (bool, error) {
  function expect (line 1529) | func expect(parser *Parser, kind lexer.TokenKind) (lexer.Token, error) {
  function expectKeyWord (line 1540) | func expectKeyWord(parser *Parser, value string) (lexer.Token, error) {
  function unexpected (line 1551) | func unexpected(parser *Parser, atToken lexer.Token) error {
  function unexpectedEmpty (line 1560) | func unexpectedEmpty(parser *Parser, beginLoc int, openKind, closeKind l...
  function reverse (line 1570) | func reverse(parser *Parser, openKind lexer.TokenKind, parseFn parseFn, ...

FILE: language/parser/parser_test.go
  function TestParser_BadToken (line 17) | func TestParser_BadToken(t *testing.T) {
  function TestParser_AcceptsOptionToNotIncludeSource (line 29) | func TestParser_AcceptsOptionToNotIncludeSource(t *testing.T) {
  function TestParser_ParseProvidesUsefulErrors (line 83) | func TestParser_ParseProvidesUsefulErrors(t *testing.T) {
  function TestParser_ParseProvidesUsefulErrorsWhenUsingSource (line 138) | func TestParser_ParseProvidesUsefulErrorsWhenUsingSource(t *testing.T) {
  function TestParser_ParsesVariableInlineValues (line 150) | func TestParser_ParsesVariableInlineValues(t *testing.T) {
  function TestParser_ParsesConstantDefaultValues (line 159) | func TestParser_ParsesConstantDefaultValues(t *testing.T) {
  function TestParser_DoesNotAcceptFragmentsNameOn (line 168) | func TestParser_DoesNotAcceptFragmentsNameOn(t *testing.T) {
  function TestParser_DoesNotAcceptFragmentsSpreadOfOn (line 177) | func TestParser_DoesNotAcceptFragmentsSpreadOfOn(t *testing.T) {
  function TestParser_DoesNotAllowNullAsValue (line 186) | func TestParser_DoesNotAllowNullAsValue(t *testing.T) {
  function TestParser_ParsesMultiByteCharacters_Unicode (line 195) | func TestParser_ParsesMultiByteCharacters_Unicode(t *testing.T) {
  function TestParser_ParsesMultiByteCharacters_UnicodeText (line 272) | func TestParser_ParsesMultiByteCharacters_UnicodeText(t *testing.T) {
  function TestParser_ParsesKitchenSink (line 349) | func TestParser_ParsesKitchenSink(t *testing.T) {
  function TestParser_AllowsNonKeywordsAnywhereNameIsAllowed (line 361) | func TestParser_AllowsNonKeywordsAnywhereNameIsAllowed(t *testing.T) {
  function TestParser_ParsesExperimentalSubscriptionFeature (line 392) | func TestParser_ParsesExperimentalSubscriptionFeature(t *testing.T) {
  function TestParser_ParsesAnonymousMutationOperations (line 404) | func TestParser_ParsesAnonymousMutationOperations(t *testing.T) {
  function TestParser_ParsesAnonymousSubscriptionOperations (line 416) | func TestParser_ParsesAnonymousSubscriptionOperations(t *testing.T) {
  function TestParser_ParsesNamedMutationOperations (line 428) | func TestParser_ParsesNamedMutationOperations(t *testing.T) {
  function TestParser_ParsesNamedSubscriptionOperations (line 440) | func TestParser_ParsesNamedSubscriptionOperations(t *testing.T) {
  function TestParser_ParsesFieldDefinitionWithDescription (line 452) | func TestParser_ParsesFieldDefinitionWithDescription(t *testing.T) {
  function TestParser_ParsesInputValueDefinitionWithDescription (line 467) | func TestParser_ParsesInputValueDefinitionWithDescription(t *testing.T) {
  function TestParser_ParsesEnumValueDefinitionWithDescription (line 484) | func TestParser_ParsesEnumValueDefinitionWithDescription(t *testing.T) {
  function TestParser_DefinitionsWithDescriptions (line 501) | func TestParser_DefinitionsWithDescriptions(t *testing.T) {
  function TestParser_ParseCreatesAst (line 612) | func TestParser_ParseCreatesAst(t *testing.T) {
  function TestParser_DoesNotAcceptStringAsDefinition (line 739) | func TestParser_DoesNotAcceptStringAsDefinition(t *testing.T) {
  type errorMessageTest (line 748) | type errorMessageTest struct
  function testErrorMessage (line 754) | func testErrorMessage(t *testing.T, test errorMessageTest) {
  function checkError (line 762) | func checkError(t *testing.T, err error, expectedError *gqlerrors.Error) {
  function checkErrorMessage (line 788) | func checkErrorMessage(t *testing.T, err error, expectedMessage string) {
  function toError (line 801) | func toError(err error) *gqlerrors.Error {

FILE: language/parser/schema_parser_test.go
  function parse (line 13) | func parse(t *testing.T, query string) *ast.Document {
  function testLoc (line 27) | func testLoc(start int, end int) *ast.Location {
  function TestSchemaParser_SimpleType (line 33) | func TestSchemaParser_SimpleType(t *testing.T) {
  function TestSchemaParser_SimpleExtension (line 77) | func TestSchemaParser_SimpleExtension(t *testing.T) {
  function TestSchemaParser_SimpleNonNullType (line 124) | func TestSchemaParser_SimpleNonNullType(t *testing.T) {
  function TestSchemaParser_SimpleTypeInheritingInterface (line 172) | func TestSchemaParser_SimpleTypeInheritingInterface(t *testing.T) {
  function TestSchemaParser_SimpleTypeInheritingMultipleInterfaces (line 203) | func TestSchemaParser_SimpleTypeInheritingMultipleInterfaces(t *testing....
  function TestSchemaParser_SimpleTypeInheritingMultipleInterfacesWithLeadingAmpersand (line 241) | func TestSchemaParser_SimpleTypeInheritingMultipleInterfacesWithLeadingA...
  function TestSchemaParser_SingleValueEnum (line 279) | func TestSchemaParser_SingleValueEnum(t *testing.T) {
  function TestSchemaParser_DoubleValueEnum (line 310) | func TestSchemaParser_DoubleValueEnum(t *testing.T) {
  function TestSchemaParser_SimpleInterface (line 349) | func TestSchemaParser_SimpleInterface(t *testing.T) {
  function TestSchemaParser_SimpleFieldWithArg (line 391) | func TestSchemaParser_SimpleFieldWithArg(t *testing.T) {
  function TestSchemaParser_SimpleFieldWithArgWithDefaultValue (line 451) | func TestSchemaParser_SimpleFieldWithArgWithDefaultValue(t *testing.T) {
  function TestSchemaParser_SimpleFieldWithListArg (line 514) | func TestSchemaParser_SimpleFieldWithListArg(t *testing.T) {
  function TestSchemaParser_SimpleFieldWithTwoArg (line 577) | func TestSchemaParser_SimpleFieldWithTwoArg(t *testing.T) {
  function TestSchemaParser_SimpleUnion (line 653) | func TestSchemaParser_SimpleUnion(t *testing.T) {
  function TestSchemaParser_UnionWithTwoTypes (line 683) | func TestSchemaParser_UnionWithTwoTypes(t *testing.T) {
  function TestSchemaParser_Scalar (line 720) | func TestSchemaParser_Scalar(t *testing.T) {
  function TestSchemaParser_SimpleInputObject (line 741) | func TestSchemaParser_SimpleInputObject(t *testing.T) {
  function TestSchemaParser_SimpleInputObjectWithArgsShouldFail (line 783) | func TestSchemaParser_SimpleInputObjectWithArgsShouldFail(t *testing.T) {

FILE: language/printer/printer.go
  function getMapValue (line 14) | func getMapValue(m map[string]interface{}, key string) interface{} {
  function getMapSliceValue (line 34) | func getMapSliceValue(m map[string]interface{}, key string) []interface{} {
  function getMapValueString (line 51) | func getMapValueString(m map[string]interface{}, key string) string {
  function getDescription (line 74) | func getDescription(raw interface{}) string {
  function toSliceString (line 95) | func toSliceString(slice interface{}) []string {
  function join (line 116) | func join(str []string, sep string) string {
  function wrap (line 128) | func wrap(start, maybeString, end string) string {
  function block (line 136) | func block(maybeArray interface{}) string {
  function indent (line 144) | func indent(maybeString interface{}) string {
  function Print (line 942) | func Print(astNode ast.Node) (printed interface{}) {

FILE: language/printer/printer_test.go
  function parse (line 14) | func parse(t *testing.T, query string) *ast.Document {
  function TestPrinter_DoesNotAlterAST (line 27) | func TestPrinter_DoesNotAlterAST(t *testing.T) {
  function TestPrinter_PrintsMinimalAST (line 49) | func TestPrinter_PrintsMinimalAST(t *testing.T) {
  function TestPrinter_CorrectlyPrintsNonQueryOperationsWithoutName (line 65) | func TestPrinter_CorrectlyPrintsNonQueryOperationsWithoutName(t *testing...
  function TestPrinter_PrintsKitchenSink (line 124) | func TestPrinter_PrintsKitchenSink(t *testing.T) {
  function TestPrinter_CorrectlyPrintsStringArgumentsWithProperQuoting (line 190) | func TestPrinter_CorrectlyPrintsStringArgumentsWithProperQuoting(t *test...
  function BenchmarkPrint (line 204) | func BenchmarkPrint(b *testing.B) {

FILE: language/printer/schema_printer_test.go
  function TestSchemaPrinter_PrintsMinimalAST (line 13) | func TestSchemaPrinter_PrintsMinimalAST(t *testing.T) {
  function TestSchemaPrinter_DoesNotAlterAST (line 26) | func TestSchemaPrinter_DoesNotAlterAST(t *testing.T) {
  function TestSchemaPrinter_PrintsKitchenSink (line 48) | func TestSchemaPrinter_PrintsKitchenSink(t *testing.T) {
  function TestSchemaPrinter_PrintsAllDescriptions (line 128) | func TestSchemaPrinter_PrintsAllDescriptions(t *testing.T) {

FILE: language/source/source.go
  constant name (line 4) | name = "GraphQL"
  type Source (line 7) | type Source struct
  function NewSource (line 12) | func NewSource(s *Source) *Source {

FILE: language/typeInfo/type_info.go
  type TypeInfoI (line 8) | type TypeInfoI interface

FILE: language/visitor/visitor.go
  constant ActionNoChange (line 11) | ActionNoChange = ""
  constant ActionBreak (line 12) | ActionBreak    = "BREAK"
  constant ActionSkip (line 13) | ActionSkip     = "SKIP"
  constant ActionUpdate (line 14) | ActionUpdate   = "UPDATE"
  type KeyMap (line 17) | type KeyMap
  type stack (line 143) | type stack struct
  type edit (line 150) | type edit struct
  type VisitFuncParams (line 155) | type VisitFuncParams struct
  type VisitFunc (line 163) | type VisitFunc
  type NamedVisitFuncs (line 165) | type NamedVisitFuncs struct
  type VisitorOptions (line 171) | type VisitorOptions struct
  function Visit (line 180) | func Visit(root ast.Node, visitorOpts *VisitorOptions, keyMap KeyMap) in...
  function pop (line 423) | func pop(a []interface{}) (interface{}, []interface{}) {
  function popNodeSlice (line 430) | func popNodeSlice(a [][]interface{}) ([]interface{}, [][]interface{}) {
  function removeNodeByIndex (line 437) | func removeNodeByIndex(a []interface{}, pos int) []interface{} {
  function convertMap (line 444) | func convertMap(src interface{}) (dest map[string]interface{}, err error) {
  function getFieldValue (line 511) | func getFieldValue(obj interface{}, key interface{}) interface{} {
  function updateNodeField (line 536) | func updateNodeField(src interface{}, targetName string, target interfac...
  function toSliceInterfaces (line 571) | func toSliceInterfaces(src interface{}) []interface{} {
  function isSlice (line 586) | func isSlice(value interface{}) bool {
  function isStructNode (line 597) | func isStructNode(node interface{}) bool {
  function isNode (line 614) | func isNode(node interface{}) bool {
  function isNilNode (line 632) | func isNilNode(node interface{}) bool {
  function VisitInParallel (line 653) | func VisitInParallel(visitorOptsSlice ...*VisitorOptions) *VisitorOptions {
  function VisitWithTypeInfo (line 707) | func VisitWithTypeInfo(ttypeInfo typeInfo.TypeInfoI, visitorOpts *Visito...
  function GetVisitFn (line 747) | func GetVisitFn(visitorOpts *VisitorOptions, kind string, isLeaving bool...

FILE: language/visitor/visitor_test.go
  function parse (line 19) | func parse(t *testing.T, query string) *ast.Document {
  function TestVisitor_AllowsEditingANodeBothOnEnterAndOnLeave (line 32) | func TestVisitor_AllowsEditingANodeBothOnEnterAndOnLeave(t *testing.T) {
  function TestVisitor_AllowsEditingTheRootNodeOnEnterAndOnLeave (line 101) | func TestVisitor_AllowsEditingTheRootNodeOnEnterAndOnLeave(t *testing.T) {
  function TestVisitor_AllowsForEditingOnEnter (line 158) | func TestVisitor_AllowsForEditingOnEnter(t *testing.T) {
  function TestVisitor_AllowsForEditingOnLeave (line 183) | func TestVisitor_AllowsForEditingOnLeave(t *testing.T) {
  function TestVisitor_VisitsEditedNode (line 208) | func TestVisitor_VisitsEditedNode(t *testing.T) {
  function TestVisitor_AllowsSkippingASubTree (line 249) | func TestVisitor_AllowsSkippingASubTree(t *testing.T) {
  function TestVisitor_AllowsEarlyExitWhileVisiting (line 310) | func TestVisitor_AllowsEarlyExitWhileVisiting(t *testing.T) {
  function TestVisitor_AllowsEarlyExitWhileLeaving (line 368) | func TestVisitor_AllowsEarlyExitWhileLeaving(t *testing.T) {
  function TestVisitor_AllowsANamedFunctionsVisitorAPI (line 427) | func TestVisitor_AllowsANamedFunctionsVisitorAPI(t *testing.T) {
  function TestVisitor_VisitsKitchenSink (line 480) | func TestVisitor_VisitsKitchenSink(t *testing.T) {
  function TestVisitor_VisitInParallel_AllowsSkippingASubTree (line 827) | func TestVisitor_VisitInParallel_AllowsSkippingASubTree(t *testing.T) {
  function TestVisitor_VisitInParallel_AllowsSkippingDifferentSubTrees (line 891) | func TestVisitor_VisitInParallel_AllowsSkippingDifferentSubTrees(t *test...
  function TestVisitor_VisitInParallel_AllowsEarlyExitWhileVisiting (line 1002) | func TestVisitor_VisitInParallel_AllowsEarlyExitWhileVisiting(t *testing...
  function TestVisitor_VisitInParallel_AllowsEarlyExitFromDifferentPoints (line 1063) | func TestVisitor_VisitInParallel_AllowsEarlyExitFromDifferentPoints(t *t...
  function TestVisitor_VisitInParallel_AllowsEarlyExitWhileLeaving (line 1156) | func TestVisitor_VisitInParallel_AllowsEarlyExitWhileLeaving(t *testing....
  function TestVisitor_VisitInParallel_AllowsEarlyExitFromLeavingDifferentPoints (line 1215) | func TestVisitor_VisitInParallel_AllowsEarlyExitFromLeavingDifferentPoin...
  function TestVisitor_VisitInParallel_AllowsForEditingOnEnter (line 1328) | func TestVisitor_VisitInParallel_AllowsForEditingOnEnter(t *testing.T) {
  function TestVisitor_VisitInParallel_AllowsForEditingOnLeave (line 1406) | func TestVisitor_VisitInParallel_AllowsForEditingOnLeave(t *testing.T) {
  function TestVisitor_VisitWithTypeInfo_MaintainsTypeInfoDuringVisit (line 1495) | func TestVisitor_VisitWithTypeInfo_MaintainsTypeInfoDuringVisit(t *testi...
  function TestVisitor_VisitWithTypeInfo_MaintainsTypeInfoDuringEdit (line 1606) | func TestVisitor_VisitWithTypeInfo_MaintainsTypeInfoDuringEdit(t *testin...

FILE: lists_test.go
  function checkList (line 13) | func checkList(t *testing.T, testType graphql.Type, testData interface{}...
  function TestLists_ListOfNullableObjects_ContainsValues (line 59) | func TestLists_ListOfNullableObjects_ContainsValues(t *testing.T) {
  function TestLists_ListOfNullableObjects_ContainsNull (line 75) | func TestLists_ListOfNullableObjects_ContainsNull(t *testing.T) {
  function TestLists_ListOfNullableObjects_ReturnsNull (line 91) | func TestLists_ListOfNullableObjects_ReturnsNull(t *testing.T) {
  function TestLists_ListOfNullableFunc_ContainsValues (line 104) | func TestLists_ListOfNullableFunc_ContainsValues(t *testing.T) {
  function TestLists_ListOfNullableFunc_ContainsNull (line 125) | func TestLists_ListOfNullableFunc_ContainsNull(t *testing.T) {
  function TestLists_ListOfNullableFunc_ReturnsNull (line 146) | func TestLists_ListOfNullableFunc_ReturnsNull(t *testing.T) {
  function TestLists_ListOfNullableArrayOfFuncContainsValues (line 165) | func TestLists_ListOfNullableArrayOfFuncContainsValues(t *testing.T) {
  function TestLists_ListOfNullableArrayOfFuncContainsNulls (line 189) | func TestLists_ListOfNullableArrayOfFuncContainsNulls(t *testing.T) {
  function TestLists_NonNullListOfNullableObjectsContainsValues (line 218) | func TestLists_NonNullListOfNullableObjectsContainsValues(t *testing.T) {
  function TestLists_NonNullListOfNullableObjectsContainsNull (line 234) | func TestLists_NonNullListOfNullableObjectsContainsNull(t *testing.T) {
  function TestLists_NonNullListOfNullableObjectsReturnsNull (line 250) | func TestLists_NonNullListOfNullableObjectsReturnsNull(t *testing.T) {
  function TestLists_NonNullListOfNullableFunc_ContainsValues (line 276) | func TestLists_NonNullListOfNullableFunc_ContainsValues(t *testing.T) {
  function TestLists_NonNullListOfNullableFunc_ContainsNull (line 297) | func TestLists_NonNullListOfNullableFunc_ContainsNull(t *testing.T) {
  function TestLists_NonNullListOfNullableFunc_ReturnsNull (line 318) | func TestLists_NonNullListOfNullableFunc_ReturnsNull(t *testing.T) {
  function TestLists_NonNullListOfNullableArrayOfFunc_ContainsValues (line 350) | func TestLists_NonNullListOfNullableArrayOfFunc_ContainsValues(t *testin...
  function TestLists_NonNullListOfNullableArrayOfFunc_ContainsNulls (line 374) | func TestLists_NonNullListOfNullableArrayOfFunc_ContainsNulls(t *testing...
  function TestLists_NullableListOfNonNullObjects_ContainsValues (line 403) | func TestLists_NullableListOfNonNullObjects_ContainsValues(t *testing.T) {
  function TestLists_NullableListOfNonNullObjects_ContainsNull (line 419) | func TestLists_NullableListOfNonNullObjects_ContainsNull(t *testing.T) {
  function TestLists_NullableListOfNonNullObjects_ReturnsNull (line 449) | func TestLists_NullableListOfNonNullObjects_ReturnsNull(t *testing.T) {
  function TestLists_NullableListOfNonNullFunc_ContainsValues (line 463) | func TestLists_NullableListOfNonNullFunc_ContainsValues(t *testing.T) {
  function TestLists_NullableListOfNonNullFunc_ContainsNull (line 484) | func TestLists_NullableListOfNonNullFunc_ContainsNull(t *testing.T) {
  function TestLists_NullableListOfNonNullFunc_ReturnsNull (line 519) | func TestLists_NullableListOfNonNullFunc_ReturnsNull(t *testing.T) {
  function TestLists_NullableListOfNonNullArrayOfFunc_ContainsValues (line 538) | func TestLists_NullableListOfNonNullArrayOfFunc_ContainsValues(t *testin...
  function TestLists_NullableListOfNonNullArrayOfFunc_ContainsNulls (line 562) | func TestLists_NullableListOfNonNullArrayOfFunc_ContainsNulls(t *testing...
  function TestLists_NonNullListOfNonNullObjects_ContainsValues (line 612) | func TestLists_NonNullListOfNonNullObjects_ContainsValues(t *testing.T) {
  function TestLists_NonNullListOfNonNullObjects_ContainsNull (line 628) | func TestLists_NonNullListOfNonNullObjects_ContainsNull(t *testing.T) {
  function TestLists_NonNullListOfNonNullObjects_ReturnsNull (line 656) | func TestLists_NonNullListOfNonNullObjects_ReturnsNull(t *testing.T) {
  function TestLists_NonNullListOfNonNullFunc_ContainsValues (line 682) | func TestLists_NonNullListOfNonNullFunc_ContainsValues(t *testing.T) {
  function TestLists_NonNullListOfNonNullFunc_ContainsNull (line 703) | func TestLists_NonNullListOfNonNullFunc_ContainsNull(t *testing.T) {
  function TestLists_NonNullListOfNonNullFunc_ReturnsNull (line 736) | func TestLists_NonNullListOfNonNullFunc_ReturnsNull(t *testing.T) {
  function TestLists_NonNullListOfNonNullArrayOfFunc_ContainsValues (line 768) | func TestLists_NonNullListOfNonNullArrayOfFunc_ContainsValues(t *testing...
  function TestLists_NonNullListOfNonNullArrayOfFunc_ContainsNulls (line 792) | func TestLists_NonNullListOfNonNullArrayOfFunc_ContainsNulls(t *testing....
  function TestLists_UserErrorExpectIterableButDidNotGetOne (line 839) | func TestLists_UserErrorExpectIterableButDidNotGetOne(t *testing.T) {
  function TestLists_ArrayOfNullableObjects_ContainsValues (line 867) | func TestLists_ArrayOfNullableObjects_ContainsValues(t *testing.T) {
  function TestLists_ValueMayBeNilPointer (line 884) | func TestLists_ValueMayBeNilPointer(t *testing.T) {
  function TestLists_NullableListOfInt_ReturnsNull (line 913) | func TestLists_NullableListOfInt_ReturnsNull(t *testing.T) {

FILE: located.go
  function NewLocatedError (line 10) | func NewLocatedError(err interface{}, nodes []ast.Node) *gqlerrors.Error {
  function NewLocatedErrorWithPath (line 14) | func NewLocatedErrorWithPath(err interface{}, nodes []ast.Node, path []i...
  function newLocatedError (line 18) | func newLocatedError(err interface{}, nodes []ast.Node, path []interface...
  function FieldASTsToNodeASTs (line 45) | func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node {

FILE: mutations_test.go
  type testNumberHolder (line 14) | type testNumberHolder struct
  type testRoot (line 17) | type testRoot struct
    method ImmediatelyChangeTheNumber (line 26) | func (r *testRoot) ImmediatelyChangeTheNumber(newNumber int) *testNumb...
    method PromiseToChangeTheNumber (line 30) | func (r *testRoot) PromiseToChangeTheNumber(newNumber int) *testNumber...
    method FailToChangeTheNumber (line 33) | func (r *testRoot) FailToChangeTheNumber(newNumber int) *testNumberHol...
    method PromiseAndFailToChangeTheNumber (line 36) | func (r *testRoot) PromiseAndFailToChangeTheNumber(newNumber int) *tes...
  function newTestRoot (line 21) | func newTestRoot(originalNumber int) *testRoot {
  function TestMutations_ExecutionOrdering_EvaluatesMutationsSerially (line 122) | func TestMutations_ExecutionOrdering_EvaluatesMutationsSerially(t *testi...
  function TestMutations_EvaluatesMutationsCorrectlyInThePresenceOfAFailedMutation (line 179) | func TestMutations_EvaluatesMutationsCorrectlyInThePresenceOfAFailedMuta...

FILE: nonnull_test.go
  function init (line 70) | func init() {
  function TestNonNull_NullsANullableFieldThatThrowsSynchronously (line 112) | func TestNonNull_NullsANullableFieldThatThrowsSynchronously(t *testing.T) {
  function TestNonNull_NullsANullableFieldThatThrowsInAPromise (line 150) | func TestNonNull_NullsANullableFieldThatThrowsInAPromise(t *testing.T) {
  function TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANullableFieldThatThrowsSynchronously (line 188) | func TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANullableF...
  function TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatThrowsInAPromise (line 229) | func TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullab...
  function TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsSynchronously (line 270) | func TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullable...
  function TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsInAPromise (line 311) | func TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullable...
  function TestNonNull_NullsAComplexTreeOfNullableFieldsThatThrow (line 353) | func TestNonNull_NullsAComplexTreeOfNullableFieldsThatThrow(t *testing.T) {
  function TestNonNull_NullsTheFirstNullableObjectAfterAFieldThrowsInALongChainOfFieldsThatAreNonNull (line 536) | func TestNonNull_NullsTheFirstNullableObjectAfterAFieldThrowsInALongChai...
  function TestNonNull_NullsANullableFieldThatSynchronouslyReturnsNull (line 652) | func TestNonNull_NullsANullableFieldThatSynchronouslyReturnsNull(t *test...
  function TestNonNull_NullsANullableFieldThatSynchronouslyReturnsNullInAPromise (line 677) | func TestNonNull_NullsANullableFieldThatSynchronouslyReturnsNullInAPromi...
  function TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullSynchronously (line 702) | func TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullab...
  function TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullInAPromise (line 741) | func TestNonNull_NullsASynchronouslyReturnedObjectThatContainsANonNullab...
  function TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullSynchronously (line 781) | func TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullable...
  function TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullInAPromise (line 820) | func TestNonNull_NullsAnObjectReturnedInAPromiseThatContainsANonNullable...
  function TestNonNull_NullsAComplexTreeOfNullableFieldsThatReturnNull (line 859) | func TestNonNull_NullsAComplexTreeOfNullableFieldsThatReturnNull(t *test...
  function TestNonNull_NullsTheFirstNullableObjectAfterAFieldReturnsNullInALongChainOfFieldsThatAreNonNull (line 930) | func TestNonNull_NullsTheFirstNullableObjectAfterAFieldReturnsNullInALon...
  function TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldThrows (line 1046) | func TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldThrows(t *testing...
  function TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldErrors (line 1078) | func TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldErrors(t *testing...
  function TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldReturnsNull (line 1110) | func TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldReturnsNull(t *te...
  function TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldResolvesNull (line 1142) | func TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldResolvesNull(t *t...

FILE: quoted_or_list_internal_test.go
  function TestQuotedOrList_DoesNoAcceptAnEmptyList (line 8) | func TestQuotedOrList_DoesNoAcceptAnEmptyList(t *testing.T) {
  function TestQuotedOrList_ReturnsSingleQuotedItem (line 15) | func TestQuotedOrList_ReturnsSingleQuotedItem(t *testing.T) {
  function TestQuotedOrList_ReturnsTwoItems (line 22) | func TestQuotedOrList_ReturnsTwoItems(t *testing.T) {
  function TestQuotedOrList_ReturnsCommaSeparatedManyItemList (line 29) | func TestQuotedOrList_ReturnsCommaSeparatedManyItemList(t *testing.T) {

FILE: race_test.go
  function TestRace (line 11) | func TestRace(t *testing.T) {

FILE: rules.go
  type ValidationRuleInstance (line 45) | type ValidationRuleInstance struct
  type ValidationRuleFn (line 48) | type ValidationRuleFn
  function newValidationError (line 50) | func newValidationError(message string, nodes []ast.Node) *gqlerrors.Err...
  function reportError (line 61) | func reportError(context *ValidationContext, message string, nodes []ast...
  function ArgumentsOfCorrectTypeRule (line 70) | func ArgumentsOfCorrectTypeRule(context *ValidationContext) *ValidationR...
  function DefaultValuesOfCorrectTypeRule (line 110) | func DefaultValuesOfCorrectTypeRule(context *ValidationContext) *Validat...
  function quoteStrings (line 166) | func quoteStrings(slice []string) []string {
  function quotedOrList (line 176) | func quotedOrList(slice []string) string {
  function UndefinedFieldMessage (line 193) | func UndefinedFieldMessage(fieldName string, ttypeName string, suggested...
  function FieldsOnCorrectTypeRule (line 207) | func FieldsOnCorrectTypeRule(context *ValidationContext) *ValidationRule...
  function getSuggestedTypeNames (line 260) | func getSuggestedTypeNames(schema *Schema, ttype Output, fieldName strin...
  function getSuggestedFieldNames (line 326) | func getSuggestedFieldNames(schema *Schema, ttype Output, fieldName stri...
  type suggestedInterface (line 346) | type suggestedInterface struct
  type suggestedInterfaceSortedSlice (line 350) | type suggestedInterfaceSortedSlice
    method Len (line 352) | func (s suggestedInterfaceSortedSlice) Len() int {
    method Swap (line 355) | func (s suggestedInterfaceSortedSlice) Swap(i, j int) {
    method Less (line 358) | func (s suggestedInterfaceSortedSlice) Less(i, j int) bool {
  function FragmentsOnCompositeTypesRule (line 370) | func FragmentsOnCompositeTypesRule(context *ValidationContext) *Validati...
  function unknownArgMessage (line 414) | func unknownArgMessage(argName string, fieldName string, parentTypeName ...
  function unknownDirectiveArgMessage (line 424) | func unknownDirectiveArgMessage(argName string, directiveName string, su...
  function KnownArgumentNamesRule (line 438) | func KnownArgumentNamesRule(context *ValidationContext) *ValidationRuleI...
  function MisplaceDirectiveMessage (line 522) | func MisplaceDirectiveMessage(directiveName string, location string) str...
  function KnownDirectivesRule (line 530) | func KnownDirectivesRule(context *ValidationContext) *ValidationRuleInst...
  function getDirectiveLocationForASTPath (line 593) | func getDirectiveLocationForASTPath(ancestors []ast.Node) string {
  function KnownFragmentNamesRule (line 671) | func KnownFragmentNamesRule(context *ValidationContext) *ValidationRuleI...
  function unknownTypeMessage (line 704) | func unknownTypeMessage(typeName string, suggestedTypes []string) string {
  function KnownTypeNamesRule (line 717) | func KnownTypeNamesRule(context *ValidationContext) *ValidationRuleInsta...
  function LoneAnonymousOperationRule (line 775) | func LoneAnonymousOperationRule(context *ValidationContext) *ValidationR...
  function CycleErrorMessage (line 813) | func CycleErrorMessage(fragName string, spreadNames []string) string {
  function NoFragmentCyclesRule (line 822) | func NoFragmentCyclesRule(context *ValidationContext) *ValidationRuleIns...
  function UndefinedVarMessage (line 927) | func UndefinedVarMessage(varName string, opName string) string {
  function NoUndefinedVariablesRule (line 938) | func NoUndefinedVariablesRule(context *ValidationContext) *ValidationRul...
  function NoUnusedFragmentsRule (line 1002) | func NoUnusedFragmentsRule(context *ValidationContext) *ValidationRuleIn...
  function UnusedVariableMessage (line 1064) | func UnusedVariableMessage(varName string, opName string) string {
  function NoUnusedVariablesRule (line 1075) | func NoUnusedVariablesRule(context *ValidationContext) *ValidationRuleIn...
  function getFragmentType (line 1138) | func getFragmentType(context *ValidationContext, name string) Type {
  function doTypesOverlap (line 1147) | func doTypesOverlap(schema *Schema, t1 Type, t2 Type) bool {
  function PossibleFragmentSpreadsRule (line 1194) | func PossibleFragmentSpreadsRule(context *ValidationContext) *Validation...
  function ProvidedNonNullArgumentsRule (line 1248) | func ProvidedNonNullArgumentsRule(context *ValidationContext) *Validatio...
  function ScalarLeafsRule (line 1344) | func ScalarLeafsRule(context *ValidationContext) *ValidationRuleInstance {
  function UniqueArgumentNamesRule (line 1388) | func UniqueArgumentNamesRule(context *ValidationContext) *ValidationRule...
  function UniqueFragmentNamesRule (line 1435) | func UniqueFragmentNamesRule(context *ValidationContext) *ValidationRule...
  function UniqueInputFieldNamesRule (line 1476) | func UniqueInputFieldNamesRule(context *ValidationContext) *ValidationRu...
  function UniqueOperationNamesRule (line 1525) | func UniqueOperationNamesRule(context *ValidationContext) *ValidationRul...
  function UniqueVariableNamesRule (line 1569) | func UniqueVariableNamesRule(context *ValidationContext) *ValidationRule...
  function VariablesAreInputTypesRule (line 1615) | func VariablesAreInputTypesRule(context *ValidationContext) *ValidationR...
  function effectiveType (line 1649) | func effectiveType(varType Type, varDef *ast.VariableDefinition) Type {
  function VariablesInAllowedPositionRule (line 1660) | func VariablesInAllowedPositionRule(context *ValidationContext) *Validat...
  function isValidLiteralValue (line 1727) | func isValidLiteralValue(ttype Input, valueAST ast.Value) (bool, []strin...
  type suggestionListResult (line 1813) | type suggestionListResult struct
    method Len (line 1818) | func (s suggestionListResult) Len() int {
    method Swap (line 1821) | func (s suggestionListResult) Swap(i, j int) {
    method Less (line 1824) | func (s suggestionListResult) Less(i, j int) bool {
  function suggestionList (line 1830) | func suggestionList(input string, options []string) []string {
  function lexicalDistance (line 1856) | func lexicalDistance(a, b string) float64 {

FILE: rules_arguments_of_correct_type_test.go
  function TestValidate_ArgValuesOfCorrectType_ValidValue_GoodIntValue (line 11) | func TestValidate_ArgValuesOfCorrectType_ValidValue_GoodIntValue(t *test...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_GoodBooleanValue (line 20) | func TestValidate_ArgValuesOfCorrectType_ValidValue_GoodBooleanValue(t *...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_GoodStringValue (line 29) | func TestValidate_ArgValuesOfCorrectType_ValidValue_GoodStringValue(t *t...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_GoodFloatValue (line 38) | func TestValidate_ArgValuesOfCorrectType_ValidValue_GoodFloatValue(t *te...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_IntIntoFloat (line 47) | func TestValidate_ArgValuesOfCorrectType_ValidValue_IntIntoFloat(t *test...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_IntIntoID (line 56) | func TestValidate_ArgValuesOfCorrectType_ValidValue_IntIntoID(t *testing...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_StringIntoID (line 65) | func TestValidate_ArgValuesOfCorrectType_ValidValue_StringIntoID(t *test...
  function TestValidate_ArgValuesOfCorrectType_ValidValue_GoodEnumValue (line 74) | func TestValidate_ArgValuesOfCorrectType_ValidValue_GoodEnumValue(t *tes...
  function TestValidate_ArgValuesOfCorrectType_InvalidStringValues_IntIntoString (line 84) | func TestValidate_ArgValuesOfCorrectType_InvalidStringValues_IntIntoStri...
  function TestValidate_ArgValuesOfCorrectType_InvalidStringValues_FloatIntoString (line 99) | func TestValidate_ArgValuesOfCorrectType_InvalidStringValues_FloatIntoSt...
  function TestValidate_ArgValuesOfCorrectType_InvalidStringValues_BooleanIntoString (line 114) | func TestValidate_ArgValuesOfCorrectType_InvalidStringValues_BooleanInto...
  function TestValidate_ArgValuesOfCorrectType_InvalidStringValues_UnquotedStringIntoString (line 129) | func TestValidate_ArgValuesOfCorrectType_InvalidStringValues_UnquotedStr...
  function TestValidate_ArgValuesOfCorrectType_InvalidIntValues_StringIntoInt (line 145) | func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_StringIntoInt(...
  function TestValidate_ArgValuesOfCorrectType_InvalidIntValues_BigIntIntoInt (line 160) | func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_BigIntIntoInt(...
  function TestValidate_ArgValuesOfCorrectType_InvalidIntValues_UnquotedStringIntoInt (line 175) | func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_UnquotedString...
  function TestValidate_ArgValuesOfCorrectType_InvalidIntValues_SimpleFloatIntoInt (line 190) | func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_SimpleFloatInt...
  function TestValidate_ArgValuesOfCorrectType_InvalidIntValues_FloatIntoInt (line 205) | func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_FloatIntoInt(t...
  function TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_StringIntoFloat (line 221) | func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_StringIntoFl...
  function TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_BooleanIntoFloat (line 236) | func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_BooleanIntoF...
  function TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_UnquotedIntoFloat (line 251) | func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_UnquotedInto...
  function TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_IntIntoBoolean (line 267) | func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_IntIntoBoo...
  function TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_FloatIntoBoolean (line 282) | func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_FloatIntoB...
  function TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_StringIntoBoolean (line 297) | func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_StringInto...
  function TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_UnquotedStringIntoBoolean (line 312) | func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_UnquotedSt...
  function TestValidate_ArgValuesOfCorrectType_InvalidIDValue_FloatIntoID (line 328) | func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_FloatIntoID(t *t...
  function TestValidate_ArgValuesOfCorrectType_InvalidIDValue_BooleanIntoID (line 343) | func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_BooleanIntoID(t ...
  function TestValidate_ArgValuesOfCorrectType_InvalidIDValue_UnquotedIntoID (line 358) | func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_UnquotedIntoID(t...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_IntIntoEnum (line 374) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_IntIntoEnum(t ...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_FloatIntoEnum (line 389) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_FloatIntoEnum(...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_StringIntoEnum (line 404) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_StringIntoEnum...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_BooleanIntoEnum (line 419) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_BooleanIntoEnu...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_UnknownEnumValueIntoEnum (line 434) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_UnknownEnumVal...
  function TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_DifferentCaseEnumValueIntoEnum (line 449) | func TestValidate_ArgValuesOfCorrectType_InvalidEnumValue_DifferentCaseE...
  function TestValidate_ArgValuesOfCorrectType_ValidListValue_GoodListValue (line 465) | func TestValidate_ArgValuesOfCorrectType_ValidListValue_GoodListValue(t ...
  function TestValidate_ArgValuesOfCorrectType_ValidListValue_EmptyListValue (line 474) | func TestValidate_ArgValuesOfCorrectType_ValidListValue_EmptyListValue(t...
  function TestValidate_ArgValuesOfCorrectType_ValidListValue_SingleValueIntoList (line 483) | func TestValidate_ArgValuesOfCorrectType_ValidListValue_SingleValueIntoL...
  function TestValidate_ArgValuesOfCorrectType_InvalidListValue_IncorrectItemType (line 493) | func TestValidate_ArgValuesOfCorrectType_InvalidListValue_IncorrectItemT...
  function TestValidate_ArgValuesOfCorrectType_InvalidListValue_SingleValueOfIncorrentType (line 508) | func TestValidate_ArgValuesOfCorrectType_InvalidListValue_SingleValueOfI...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_ArgOnOptionalArg (line 524) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_ArgOnOpti...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_NoArgOnOptionalArg (line 533) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_NoArgOnOp...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleArgs (line 542) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleA...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleArgsReverseOrder (line 551) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleA...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_NoArgsOnMultipleOptional (line 560) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_NoArgsOnM...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_OneArgOnMultipleOptional (line 569) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_OneArgOnM...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_SecondArgOnMultipleOptional (line 578) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_SecondArg...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleRequiredsOnMixedList (line 587) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleR...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleRequiredsAndOptionalOnMixedList (line 596) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_MultipleR...
  function TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_AllRequiredsAndOptionalOnMixedList (line 605) | func TestValidate_ArgValuesOfCorrectType_ValidNonNullableValue_AllRequir...
  function TestValidate_ArgValuesOfCorrectType_InvalidNonNullableValue_IncorrectValueType (line 615) | func TestValidate_ArgValuesOfCorrectType_InvalidNonNullableValue_Incorre...
  function TestValidate_ArgValuesOfCorrectType_InvalidNonNullableValue_IncorrectValueAndMissingArgument (line 634) | func TestValidate_ArgValuesOfCorrectType_InvalidNonNullableValue_Incorre...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_OptionalArg_DespiteRequiredFieldInType (line 650) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_OptionalA...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialObject_OnlyRequired (line 659) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialOb...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialObject_RequiredFieldCanBeFalsey (line 668) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialOb...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialObject_IncludingRequired (line 677) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_PartialOb...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_FullObject (line 686) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_FullObjec...
  function TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_FullObject_WithFieldsInDifferentOrder (line 701) | func TestValidate_ArgValuesOfCorrectType_ValidInputObjectValue_FullObjec...
  function TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_PartialObject_MissingRequired (line 717) | func TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_Partial...
  function TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_PartialObject_InvalidFieldType (line 732) | func TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_Partial...
  function TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_PartialObject_UnknownFieldArg (line 750) | func TestValidate_ArgValuesOfCorrectType_InvalidInputObjectValue_Partial...
  function TestValidate_ArgValuesOfCorrectType_DirectiveArguments_WithDirectivesOfValidType (line 769) | func TestValidate_ArgValuesOfCorrectType_DirectiveArguments_WithDirectiv...
  function TestValidate_ArgValuesOfCorrectType_DirectiveArguments_WithDirectivesWithIncorrectTypes (line 781) | func TestValidate_ArgValuesOfCorrectType_DirectiveArguments_WithDirectiv...

FILE: rules_default_values_of_correct_type_test.go
  function TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithNoDefaultValues (line 11) | func TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithNoDefa...
  function TestValidate_VariableDefaultValuesOfCorrectType_RequiredVariablesWithoutDefaultValues (line 18) | func TestValidate_VariableDefaultValuesOfCorrectType_RequiredVariablesWi...
  function TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithValidDefaultValues (line 25) | func TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithValidD...
  function TestValidate_VariableDefaultValuesOfCorrectType_NoRequiredVariablesWithDefaultValues (line 36) | func TestValidate_VariableDefaultValuesOfCorrectType_NoRequiredVariables...
  function TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithInvalidDefaultValues (line 55) | func TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithInvali...
  function TestValidate_VariableDefaultValuesOfCorrectType_ComplexVariablesMissingRequiredField (line 78) | func TestValidate_VariableDefaultValuesOfCorrectType_ComplexVariablesMis...
  function TestValidate_VariableDefaultValuesOfCorrectType_ListVariablesWithInvalidItem (line 91) | func TestValidate_VariableDefaultValuesOfCorrectType_ListVariablesWithIn...
  function TestValidate_VariableDefaultValuesOfCorrectType_InvalidNonNull (line 105) | func TestValidate_VariableDefaultValuesOfCorrectType_InvalidNonNull(t *t...

FILE: rules_fields_on_correct_type_test.go
  function TestValidate_FieldsOnCorrectType_ObjectFieldSelection (line 11) | func TestValidate_FieldsOnCorrectType_ObjectFieldSelection(t *testing.T) {
  function TestValidate_FieldsOnCorrectType_AliasedObjectFieldSelection (line 19) | func TestValidate_FieldsOnCorrectType_AliasedObjectFieldSelection(t *tes...
  function TestValidate_FieldsOnCorrectType_InterfaceFieldSelection (line 27) | func TestValidate_FieldsOnCorrectType_InterfaceFieldSelection(t *testing...
  function TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection (line 35) | func TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection(t *...
  function TestValidate_FieldsOnCorrectType_LyingAliasSelection (line 42) | func TestValidate_FieldsOnCorrectType_LyingAliasSelection(t *testing.T) {
  function TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType (line 49) | func TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType(t *test...
  function TestValidate_FieldsOnCorrectType_ReportErrorsWhenTheTypeIsKnownAgain (line 56) | func TestValidate_FieldsOnCorrectType_ReportErrorsWhenTheTypeIsKnownAgai...
  function TestValidate_FieldsOnCorrectType_FieldNotDefinedOnFragment (line 70) | func TestValidate_FieldsOnCorrectType_FieldNotDefinedOnFragment(t *testi...
  function TestValidate_FieldsOnCorrectType_IgnoreDeeplyUnknownField (line 79) | func TestValidate_FieldsOnCorrectType_IgnoreDeeplyUnknownField(t *testin...
  function TestValidate_FieldsOnCorrectType_SubFieldNotDefined (line 90) | func TestValidate_FieldsOnCorrectType_SubFieldNotDefined(t *testing.T) {
  function TestValidate_FieldsOnCorrectType_FieldNotDefinedOnInlineFragment (line 101) | func TestValidate_FieldsOnCorrectType_FieldNotDefinedOnInlineFragment(t ...
  function TestValidate_FieldsOnCorrectType_AliasedFieldTargetNotDefined (line 112) | func TestValidate_FieldsOnCorrectType_AliasedFieldTargetNotDefined(t *te...
  function TestValidate_FieldsOnCorrectType_AliasedLyingFieldTargetNotDefined (line 121) | func TestValidate_FieldsOnCorrectType_AliasedLyingFieldTargetNotDefined(...
  function TestValidate_FieldsOnCorrectType_NotDefinedOnInterface (line 130) | func TestValidate_FieldsOnCorrectType_NotDefinedOnInterface(t *testing.T) {
  function TestValidate_FieldsOnCorrectType_DefinedOnImplementorsButNotOnInterface (line 139) | func TestValidate_FieldsOnCorrectType_DefinedOnImplementorsButNotOnInter...
  function TestValidate_FieldsOnCorrectType_MetaFieldSelectionOnUnion (line 148) | func TestValidate_FieldsOnCorrectType_MetaFieldSelectionOnUnion(t *testi...
  function TestValidate_FieldsOnCorrectType_DirectFieldSelectionOnUnion (line 155) | func TestValidate_FieldsOnCorrectType_DirectFieldSelectionOnUnion(t *tes...
  function TestValidate_FieldsOnCorrectType_DefinedImplementorsQueriedOnUnion (line 164) | func TestValidate_FieldsOnCorrectType_DefinedImplementorsQueriedOnUnion(...
  function TestValidate_FieldsOnCorrectType_ValidFieldInInlineFragment (line 173) | func TestValidate_FieldsOnCorrectType_ValidFieldInInlineFragment(t *test...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSuggestions (line 186) | func TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSuggestions...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSmallNumbersOfTypeSuggestions (line 194) | func TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSmallNumber...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSmallNumbersOfFieldSuggestions (line 203) | func TestValidate_FieldsOnCorrectTypeErrorMessage_WorksWithNoSmallNumber...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_OnlyShowsOneSetOfSuggestionsAtATimePreferringTypes (line 211) | func TestValidate_FieldsOnCorrectTypeErrorMessage_OnlyShowsOneSetOfSugge...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_LimitLotsOfTypeSuggestions (line 220) | func TestValidate_FieldsOnCorrectTypeErrorMessage_LimitLotsOfTypeSuggest...
  function TestValidate_FieldsOnCorrectTypeErrorMessage_LimitLotsOfFieldSuggestions (line 229) | func TestValidate_FieldsOnCorrectTypeErrorMessage_LimitLotsOfFieldSugges...
  function TestValidate_FieldsOnCorrectType_NilCrash (line 240) | func TestValidate_FieldsOnCorrectType_NilCrash(t *testing.T) {

FILE: rules_fragments_on_composite_types_test.go
  function TestValidate_FragmentsOnCompositeTypes_ObjectIsValidFragmentType (line 11) | func TestValidate_FragmentsOnCompositeTypes_ObjectIsValidFragmentType(t ...
  function TestValidate_FragmentsOnCompositeTypes_InterfaceIsValidFragmentType (line 18) | func TestValidate_FragmentsOnCompositeTypes_InterfaceIsValidFragmentType...
  function TestValidate_FragmentsOnCompositeTypes_ObjectIsValidInlineFragmentType (line 25) | func TestValidate_FragmentsOnCompositeTypes_ObjectIsValidInlineFragmentT...
  function TestValidate_FragmentsOnCompositeTypes_InlineFragmentWithoutTypeIsValid (line 34) | func TestValidate_FragmentsOnCompositeTypes_InlineFragmentWithoutTypeIsV...
  function TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType (line 43) | func TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType(t *...
  function TestValidate_FragmentsOnCompositeTypes_ScalarIsInvalidFragmentType (line 50) | func TestValidate_FragmentsOnCompositeTypes_ScalarIsInvalidFragmentType(...
  function TestValidate_FragmentsOnCompositeTypes_EnumIsInvalidFragmentType (line 59) | func TestValidate_FragmentsOnCompositeTypes_EnumIsInvalidFragmentType(t ...
  function TestValidate_FragmentsOnCompositeTypes_InputObjectIsInvalidFragmentType (line 68) | func TestValidate_FragmentsOnCompositeTypes_InputObjectIsInvalidFragment...
  function TestValidate_FragmentsOnCompositeTypes_ScalarIsInvalidInlineFragmentType (line 77) | func TestValidate_FragmentsOnCompositeTypes_ScalarIsInvalidInlineFragmen...

FILE: rules_known_argument_names_test.go
  function TestValidate_KnownArgumentNames_SingleArgIsKnown (line 11) | func TestValidate_KnownArgumentNames_SingleArgIsKnown(t *testing.T) {
  function TestValidate_KnownArgumentNames_MultipleArgsAreKnown (line 18) | func TestValidate_KnownArgumentNames_MultipleArgsAreKnown(t *testing.T) {
  function TestValidate_KnownArgumentNames_IgnoresArgsOfUnknownFields (line 25) | func TestValidate_KnownArgumentNames_IgnoresArgsOfUnknownFields(t *testi...
  function TestValidate_KnownArgumentNames_MultipleArgsInReverseOrderAreKnown (line 32) | func TestValidate_KnownArgumentNames_MultipleArgsInReverseOrderAreKnown(...
  function TestValidate_KnownArgumentNames_NoArgsOnOptionalArg (line 39) | func TestValidate_KnownArgumentNames_NoArgsOnOptionalArg(t *testing.T) {
  function TestValidate_KnownArgumentNames_ArgsAreKnownDeeply (line 46) | func TestValidate_KnownArgumentNames_ArgsAreKnownDeeply(t *testing.T) {
  function TestValidate_KnownArgumentNames_DirectiveArgsAreKnown (line 62) | func TestValidate_KnownArgumentNames_DirectiveArgsAreKnown(t *testing.T) {
  function TestValidate_KnownArgumentNames_UndirectiveArgsAreInvalid (line 69) | func TestValidate_KnownArgumentNames_UndirectiveArgsAreInvalid(t *testin...
  function TestValidate_KnownArgumentNames_UndirectiveArgsAreInvalidWithSuggestion (line 78) | func TestValidate_KnownArgumentNames_UndirectiveArgsAreInvalidWithSugges...
  function TestValidate_KnownArgumentNames_InvalidArgName (line 88) | func TestValidate_KnownArgumentNames_InvalidArgName(t *testing.T) {
  function TestValidate_KnownArgumentNames_UnknownArgsAmongstKnownArgs (line 97) | func TestValidate_KnownArgumentNames_UnknownArgsAmongstKnownArgs(t *test...
  function TestValidate_KnownArgumentNames_UnknownArgsAmongstKnownArgsWithSuggestions (line 107) | func TestValidate_KnownArgumentNames_UnknownArgsAmongstKnownArgsWithSugg...
  function TestValidate_KnownArgumentNames_UnknownArgsDeeply (line 117) | func TestValidate_KnownArgumentNames_UnknownArgsDeeply(t *testing.T) {

FILE: rules_known_directives_rule_test.go
  function TestValidate_KnownDirectives_WithNoDirectives (line 11) | func TestValidate_KnownDirectives_WithNoDirectives(t *testing.T) {
  function TestValidate_KnownDirectives_WithKnownDirective (line 23) | func TestValidate_KnownDirectives_WithKnownDirective(t *testing.T) {
  function TestValidate_KnownDirectives_WithUnknownDirective (line 35) | func TestValidate_KnownDirectives_WithUnknownDirective(t *testing.T) {
  function TestValidate_KnownDirectives_WithManyUnknownDirectives (line 46) | func TestValidate_KnownDirectives_WithManyUnknownDirectives(t *testing.T) {
  function TestValidate_KnownDirectives_WithWellPlacedDirectives (line 65) | func TestValidate_KnownDirectives_WithWellPlacedDirectives(t *testing.T) {
  function TestValidate_KnownDirectives_WithMisplacedDirectives (line 79) | func TestValidate_KnownDirectives_WithMisplacedDirectives(t *testing.T) {
  function TestValidate_KnownDirectives_WithinSchemaLanguage_WithWellPlacedDirectives (line 97) | func TestValidate_KnownDirectives_WithinSchemaLanguage_WithWellPlacedDir...
  function TestValidate_KnownDirectives_WithinSchemaLanguage_WithMisplacedDirectives (line 125) | func TestValidate_KnownDirectives_WithinSchemaLanguage_WithMisplacedDire...

FILE: rules_known_fragment_names_test.go
  function TestValidate_KnownFragmentNames_KnownFragmentNamesAreValid (line 11) | func TestValidate_KnownFragmentNames_KnownFragmentNamesAreValid(t *testi...
  function TestValidate_KnownFragmentNames_UnknownFragmentNamesAreInvalid (line 36) | func TestValidate_KnownFragmentNames_UnknownFragmentNamesAreInvalid(t *t...

FILE: rules_known_type_names_test.go
  function TestValidate_KnownTypeNames_KnownTypeNamesAreValid (line 11) | func TestValidate_KnownTypeNames_KnownTypeNamesAreValid(t *testing.T) {
  function TestValidate_KnownTypeNames_UnknownTypeNamesAreInValid (line 23) | func TestValidate_KnownTypeNames_UnknownTypeNamesAreInValid(t *testing.T) {
  function TestValidate_KnownTypeNames_IgnoresTypeDefinitions (line 41) | func TestValidate_KnownTypeNames_IgnoresTypeDefinitions(t *testing.T) {

FILE: rules_lone_anonymous_operation_rule_test.go
  function TestValidate_AnonymousOperationMustBeAlone_NoOperations (line 11) | func TestValidate_AnonymousOperationMustBeAlone_NoOperations(t *testing....
  function TestValidate_AnonymousOperationMustBeAlone_OneAnonOperation (line 18) | func TestValidate_AnonymousOperationMustBeAlone_OneAnonOperation(t *test...
  function TestValidate_AnonymousOperationMustBeAlone_MultipleNamedOperations (line 25) | func TestValidate_AnonymousOperationMustBeAlone_MultipleNamedOperations(...
  function TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithFragment (line 36) | func TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithFragmen...
  function TestValidate_AnonymousOperationMustBeAlone_MultipleAnonOperations (line 46) | func TestValidate_AnonymousOperationMustBeAlone_MultipleAnonOperations(t...
  function TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithAMutation (line 59) | func TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithAMutati...
  function TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithASubscription (line 72) | func TestValidate_AnonymousOperationMustBeAlone_AnonOperationWithASubscr...

FILE: rules_no_fragment_cycles_test.go
  function TestValidate_NoCircularFragmentSpreads_SingleReferenceIsValid (line 11) | func TestValidate_NoCircularFragmentSpreads_SingleReferenceIsValid(t *te...
  function TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIsNotCircular (line 17) | func TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIsNotCircular(...
  function TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIndirectlyIsNotCircular (line 23) | func TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIndirectlyIsNo...
  function TestValidate_NoCircularFragmentSpreads_DoubleSpreadWithinAbstractTypes (line 30) | func TestValidate_NoCircularFragmentSpreads_DoubleSpreadWithinAbstractTy...
  function TestValidate_NoCircularFragmentSpreads_DoesNotFalsePositiveOnUnknownFragment (line 43) | func TestValidate_NoCircularFragmentSpreads_DoesNotFalsePositiveOnUnknow...
  function TestValidate_NoCircularFragmentSpreads_SpreadingRecursivelyWithinFieldFails (line 50) | func TestValidate_NoCircularFragmentSpreads_SpreadingRecursivelyWithinFi...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDirectly (line 58) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDirectly(t ...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDirectlyWithinInlineFragment (line 65) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDirectlyWit...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectly (line 77) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectly(...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectlyReportsOppositeOrder (line 85) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectlyR...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectlyWithinInlineFragment (line 93) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfIndirectlyW...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeply (line 110) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeply(t *t...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyTwoPaths (line 135) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyTwoPa...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyTwoPaths_AltTraverseOrder (line 149) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyTwoPa...
  function TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyAndImmediately (line 163) | func TestValidate_NoCircularFragmentSpreads_NoSpreadingItselfDeeplyAndIm...

FILE: rules_no_undefined_variables_test.go
  function TestValidate_NoUndefinedVariables_AllVariablesDefined (line 11) | func TestValidate_NoUndefinedVariables_AllVariablesDefined(t *testing.T) {
  function TestValidate_NoUndefinedVariables_AllVariablesDeeplyDefined (line 18) | func TestValidate_NoUndefinedVariables_AllVariablesDeeplyDefined(t *test...
  function TestValidate_NoUndefinedVariables_AllVariablesDeeplyDefinedInInlineFragmentsDefined (line 29) | func TestValidate_NoUndefinedVariables_AllVariablesDeeplyDefinedInInline...
  function TestValidate_NoUndefinedVariables_AllVariablesInFragmentsDeeplyDefined (line 44) | func TestValidate_NoUndefinedVariables_AllVariablesInFragmentsDeeplyDefi...
  function TestValidate_NoUndefinedVariables_VariablesWithinSingleFragmentDefinedInMultipleOperations (line 64) | func TestValidate_NoUndefinedVariables_VariablesWithinSingleFragmentDefi...
  function TestValidate_NoUndefinedVariables_VariableWithinFragmentsDefinedInOperations (line 77) | func TestValidate_NoUndefinedVariables_VariableWithinFragmentsDefinedInO...
  function TestValidate_NoUndefinedVariables_VariableWithinRecursiveFragmentDefined (line 93) | func TestValidate_NoUndefinedVariables_VariableWithinRecursiveFragmentDe...
  function TestValidate_NoUndefinedVariables_VariableNotDefined (line 105) | func TestValidate_NoUndefinedVariables_VariableNotDefined(t *testing.T) {
  function TestValidate_NoUndefinedVariables_VariableNotDefinedByUnnamedQuery (line 114) | func TestValidate_NoUndefinedVariables_VariableNotDefinedByUnnamedQuery(...
  function TestValidate_NoUndefinedVariables_MultipleVariablesNotDefined (line 123) | func TestValidate_NoUndefinedVariables_MultipleVariablesNotDefined(t *te...
  function TestValidate_NoUndefinedVariables_VariableInFragmentNotDefinedByUnnamedQuery (line 133) | func TestValidate_NoUndefinedVariables_VariableInFragmentNotDefinedByUnn...
  function TestValidate_NoUndefinedVariables_VariableInFragmentNotDefinedByOperation (line 145) | func TestValidate_NoUndefinedVariables_VariableInFragmentNotDefinedByOpe...
  function TestValidate_NoUndefinedVariables_MultipleVariablesInFragmentsNotDefined (line 167) | func TestValidate_NoUndefinedVariables_MultipleVariablesInFragmentsNotDe...
  function TestValidate_NoUndefinedVariables_SingleVariableInFragmentNotDefinedByMultipleOperations (line 190) | func TestValidate_NoUndefinedVariables_SingleVariableInFragmentNotDefine...
  function TestValidate_NoUndefinedVariables_VariablesInFragmentNotDefinedByMultipleOperations (line 206) | func TestValidate_NoUndefinedVariables_VariablesInFragmentNotDefinedByMu...
  function TestValidate_NoUndefinedVariables_VariableInFragmentUsedByOtherOperation (line 222) | func TestValidate_NoUndefinedVariables_VariableInFragmentUsedByOtherOper...
  function TestValidate_NoUndefinedVariables_VaMultipleUndefinedVariablesProduceMultipleErrors (line 241) | func TestValidate_NoUndefinedVariables_VaMultipleUndefinedVariablesProdu...

FILE: rules_no_unused_fragments_test.go
  function TestValidate_NoUnusedFragments_AllFragmentNamesAreUsed (line 11) | func TestValidate_NoUnusedFragments_AllFragmentNamesAreUsed(t *testing.T) {
  function TestValidate_NoUnusedFragments_AllFragmentNamesAreUsedByMultipleOperations (line 33) | func TestValidate_NoUnusedFragments_AllFragmentNamesAreUsedByMultipleOpe...
  function TestValidate_NoUnusedFragments_ContainsUnknownFragments (line 57) | func TestValidate_NoUnusedFragments_ContainsUnknownFragments(t *testing....
  function TestValidate_NoUnusedFragments_ContainsUnknownFragmentsWithRefCycle (line 90) | func TestValidate_NoUnusedFragments_ContainsUnknownFragmentsWithRefCycle...
  function TestValidate_NoUnusedFragments_ContainsUnknownAndUndefFragments (line 125) | func TestValidate_NoUnusedFragments_ContainsUnknownAndUndefFragments(t *...

FILE: rules_no_unused_variables_test.go
  function TestValidate_NoUnusedVariables_UsesAllVariables (line 11) | func TestValidate_NoUnusedVariables_UsesAllVariables(t *testing.T) {
  function TestValidate_NoUnusedVariables_UsesAllVariablesDeeply (line 18) | func TestValidate_NoUnusedVariables_UsesAllVariablesDeeply(t *testing.T) {
  function TestValidate_NoUnusedVariables_UsesAllVariablesDeeplyInInlineFragments (line 29) | func TestValidate_NoUnusedVariables_UsesAllVariablesDeeplyInInlineFragme...
  function TestValidate_NoUnusedVariables_UsesAllVariablesInFragments (line 44) | func TestValidate_NoUnusedVariables_UsesAllVariablesInFragments(t *testi...
  function TestValidate_NoUnusedVariables_VariableUsedByFragmentInMultipleOperations (line 64) | func TestValidate_NoUnusedVariables_VariableUsedByFragmentInMultipleOper...
  function TestValidate_NoUnusedVariables_VariableUsedByRecursiveFragment (line 80) | func TestValidate_NoUnusedVariables_VariableUsedByRecursiveFragment(t *t...
  function TestValidate_NoUnusedVariables_VariableNotUsed (line 92) | func TestValidate_NoUnusedVariables_VariableNotUsed(t *testing.T) {
  function TestValidate_NoUnusedVariables_MultipleVariablesNotUsed (line 101) | func TestValidate_NoUnusedVariables_MultipleVariablesNotUsed(t *testing....
  function TestValidate_NoUnusedVariables_VariableNotUsedInFragments (line 111) | func TestValidate_NoUnusedVariables_VariableNotUsedInFragments(t *testin...
  function TestValidate_NoUnusedVariables_MultipleVariablesNotUsed2 (line 133) | func TestValidate_NoUnusedVariables_MultipleVariablesNotUsed2(t *testing...
  function TestValidate_NoUnusedVariables_VariableNotUsedByUnreferencedFragment (line 156) | func TestValidate_NoUnusedVariables_VariableNotUsedByUnreferencedFragmen...
  function TestValidate_NoUnusedVariables_VariableNotUsedByFragmentUsedByOtherOperation (line 171) | func TestValidate_NoUnusedVariables_VariableNotUsedByFragmentUsedByOther...

FILE: rules_overlapping_fields_can_be_merged.go
  function fieldsConflictMessage (line 13) | func fieldsConflictMessage(responseName string, reason conflictReason) s...
  function fieldsConflictReasonMessage (line 21) | func fieldsConflictReasonMessage(message interface{}) string {
  function OverlappingFieldsCanBeMergedRule (line 46) | func OverlappingFieldsCanBeMergedRule(context *ValidationContext) *Valid...
  type overlappingFieldsCanBeMergedRule (line 149) | type overlappingFieldsCanBeMergedRule struct
    method findConflictsWithinSelectionSet (line 166) | func (rule *overlappingFieldsCanBeMergedRule) findConflictsWithinSelec...
    method collectConflictsBetweenFieldsAndFragment (line 194) | func (rule *overlappingFieldsCanBeMergedRule) collectConflictsBetweenF...
    method collectConflictsBetweenFragments (line 218) | func (rule *overlappingFieldsCanBeMergedRule) collectConflictsBetweenF...
    method findConflictsBetweenSubSelectionSets (line 262) | func (rule *overlappingFieldsCanBeMergedRule) findConflictsBetweenSubS...
    method collectConflictsWithin (line 295) | func (rule *overlappingFieldsCanBeMergedRule) collectConflictsWithin(c...
    method collectConflictsBetween (line 330) | func (rule *overlappingFieldsCanBeMergedRule) collectConflictsBetween(...
    method findConflict (line 357) | func (rule *overlappingFieldsCanBeMergedRule) findConflict(parentField...
    method getFieldsAndFragmentNames (line 450) | func (rule *overlappingFieldsCanBeMergedRule) getFieldsAndFragmentName...
    method getReferencedFieldsAndFragmentNames (line 528) | func (rule *overlappingFieldsCanBeMergedRule) getReferencedFieldsAndFr...
  type conflictReason (line 540) | type conflictReason struct
  type conflict (line 544) | type conflict struct
  type fieldDefPair (line 551) | type fieldDefPair struct
  type astAndDefCollection (line 556) | type astAndDefCollection
  type fieldsAndFragmentNames (line 559) | type fieldsAndFragmentNames struct
  type pairSet (line 567) | type pairSet struct
    method Has (line 576) | func (pair *pairSet) Has(a string, b string, areMutuallyExclusive bool...
    method Add (line 593) | func (pair *pairSet) Add(a string, b string, areMutuallyExclusive bool) {
  function newPairSet (line 571) | func newPairSet() *pairSet {
  function pairSetAdd (line 597) | func pairSetAdd(data map[string]map[string]bool, a, b string, areMutuall...
  function sameArguments (line 607) | func sameArguments(args1 []*ast.Argument, args2 []*ast.Argument) bool {
  function sameValue (line 640) | func sameValue(value1 ast.Value, value2 ast.Value) bool {
  function doTypesConflict (line 653) | func doTypesConflict(type1 Output, type2 Output) bool {
  function subfieldConflicts (line 685) | func subfieldConflicts(conflicts []conflict, responseName string, ast1 *...

FILE: rules_overlapping_fields_can_be_merged_test.go
  function TestValidate_OverlappingFieldsCanBeMerged_UniqueFields (line 11) | func TestValidate_OverlappingFieldsCanBeMerged_UniqueFields(t *testing.T) {
  function TestValidate_OverlappingFieldsCanBeMerged_IdenticalFields (line 19) | func TestValidate_OverlappingFieldsCanBeMerged_IdenticalFields(t *testin...
  function TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithIdenticalArgs (line 27) | func TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithIdenti...
  function TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithMultipleIdenticalArgs (line 35) | func TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithMultip...
  function TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithIdenticalDirectives (line 43) | func TestValidate_OverlappingFieldsCanBeMerged_IdenticalFieldsWithIdenti...
  function TestValidate_OverlappingFieldsCanBeMerged_DifferentArgsWithDifferentAliases (line 51) | func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgsWithDifferen...
  function TestValidate_OverlappingFieldsCanBeMerged_DifferentDirectivesWithDifferentAliases (line 59) | func TestValidate_OverlappingFieldsCanBeMerged_DifferentDirectivesWithDi...
  function TestValidate_OverlappingFieldsCanBeMerged_DifferentSkipIncludeDirectivesAccepted (line 67) | func TestValidate_OverlappingFieldsCanBeMerged_DifferentSkipIncludeDirec...
  function TestValidate_OverlappingFieldsCanBeMerged_SameAliasesWithDifferentFieldTargets (line 78) | func TestValidate_OverlappingFieldsCanBeMerged_SameAliasesWithDifferentF...
  function TestValidate_OverlappingFieldsCanBeMerged_SameAliasesAllowedOnNonOverlappingFields (line 90) | func TestValidate_OverlappingFieldsCanBeMerged_SameAliasesAllowedOnNonOv...
  function TestValidate_OverlappingFieldsCanBeMerged_AliasMaskingDirectFieldAccess (line 102) | func TestValidate_OverlappingFieldsCanBeMerged_AliasMaskingDirectFieldAc...
  function TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondAddsAnArgument (line 114) | func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondAddsA...
  function TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondMissingAnArgument (line 126) | func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondMissi...
  function TestValidate_OverlappingFieldsCanBeMerged_ConflictingArgs (line 138) | func TestValidate_OverlappingFieldsCanBeMerged_ConflictingArgs(t *testin...
  function TestValidate_OverlappingFieldsCanBeMerged_AllowDifferentArgsWhereNoConflictIsPossible (line 150) | func TestValidate_OverlappingFieldsCanBeMerged_AllowDifferentArgsWhereNo...
  function TestValidate_OverlappingFieldsCanBeMerged_EncountersConflictInFragments (line 164) | func TestValidate_OverlappingFieldsCanBeMerged_EncountersConflictInFragm...
  function TestValidate_OverlappingFieldsCanBeMerged_ReportsEachConflictOnce (line 182) | func TestValidate_OverlappingFieldsCanBeMerged_ReportsEachConflictOnce(t...
  function TestValidate_OverlappingFieldsCanBeMerged_DeepConflict (line 217) | func TestValidate_OverlappingFieldsCanBeMerged_DeepConflict(t *testing.T) {
  function TestValidate_OverlappingFieldsCanBeMerged_DeepConflictWithMultipleIssues (line 236) | func TestValidate_OverlappingFieldsCanBeMerged_DeepConflictWithMultipleI...
  function TestValidate_OverlappingFieldsCanBeMerged_VeryDeepConflict (line 260) | func TestValidate_OverlappingFieldsCanBeMerged_VeryDeepConflict(t *testi...
  function TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictToNearestCommonAncestor (line 286) | func TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictToNear...
  function TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictToNearestCommonAncestorInFragments (line 313) | func TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictToNear...
  function TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictInNestedFragments (line 348) | func TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictInNest...
  function TestValidate_OverlappingFieldsCanBeMerged_IgnoresUnknownFragments (line 385) | func TestValidate_OverlappingFieldsCanBeMerged_IgnoresUnknownFragments(t...
  function init (line 405) | func init() {
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_ConflictingReturnTypesWhichPotentiallyOverlap (line 585) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_CompatibleReturnShapesOnDifferentReturnTypes (line 608) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingReturnTypesDespiteNoOverlap (line 629) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_ReportsCorrectlyWhenANonExclusiveFollosAnExclusive (line 648) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingReturnTypeNullabilityDespiteNoOverlap (line 702) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingReturnTypeListDespiteNoOverlap (line 721) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingSubfields (line 766) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingDeepReturnTypesDespiteNoOverlap (line 790) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_AllowsNonConflictingOverlappingTypes (line 815) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_SameWrappedScalarReturnTypes (line 829) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_AllowsInlineTypelessFragments (line 843) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_ComparesDeepTypesIncludingList (line 853) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_IgnoresUnknownTypes (line 885) | func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambigu...
  function TestValidate_OverlappingFieldsCanBeMerged_NilCrash (line 900) | func TestValidate_OverlappingFieldsCanBeMerged_NilCrash(t *testing.T) {

FILE: rules_possible_fragment_spreads_test.go
  function TestValidate_PossibleFragmentSpreads_OfTheSameObject (line 11) | func TestValidate_PossibleFragmentSpreads_OfTheSameObject(t *testing.T) {
  function TestValidate_PossibleFragmentSpreads_OfTheSameObjectWithInlineFragment (line 17) | func TestValidate_PossibleFragmentSpreads_OfTheSameObjectWithInlineFragm...
  function TestValidate_PossibleFragmentSpreads_ObjectIntoAnImplementedInterface (line 22) | func TestValidate_PossibleFragmentSpreads_ObjectIntoAnImplementedInterfa...
  function TestValidate_PossibleFragmentSpreads_ObjectIntoContainingUnion (line 28) | func TestValidate_PossibleFragmentSpreads_ObjectIntoContainingUnion(t *t...
  function TestValidate_PossibleFragmentSpreads_UnionIntoContainedObject (line 35) | func TestValidate_PossibleFragmentSpreads_UnionIntoContainedObject(t *te...
  function TestValidate_PossibleFragmentSpreads_UnionIntoOverlappingInterface (line 41) | func TestValidate_PossibleFragmentSpreads_UnionIntoOverlappingInterface(...
  function TestValidate_PossibleFragmentSpreads_UnionIntoOverlappingUnion (line 47) | func TestValidate_PossibleFragmentSpreads_UnionIntoOverlappingUnion(t *t...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoImplementedObject (line 54) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoImplementedObject...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingInterface (line 60) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingInterf...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingInterfaceInInlineFragment (line 66) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingInterf...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingUnion (line 71) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoOverlappingUnion(...
  function TestValidate_PossibleFragmentSpreads_DifferentObjectIntoObject (line 77) | func TestValidate_PossibleFragmentSpreads_DifferentObjectIntoObject(t *t...
  function TestValidate_PossibleFragmentSpreads_DifferentObjectIntoObjectInInlineFragment (line 86) | func TestValidate_PossibleFragmentSpreads_DifferentObjectIntoObjectInInl...
  function TestValidate_PossibleFragmentSpreads_ObjectIntoNotImplementingInterface (line 97) | func TestValidate_PossibleFragmentSpreads_ObjectIntoNotImplementingInter...
  function TestValidate_PossibleFragmentSpreads_ObjectIntoNotContainingUnion (line 106) | func TestValidate_PossibleFragmentSpreads_ObjectIntoNotContainingUnion(t...
  function TestValidate_PossibleFragmentSpreads_UnionIntoNotContainedObject (line 116) | func TestValidate_PossibleFragmentSpreads_UnionIntoNotContainedObject(t ...
  function TestValidate_PossibleFragmentSpreads_UnionIntoNonOverlappingInterface (line 125) | func TestValidate_PossibleFragmentSpreads_UnionIntoNonOverlappingInterfa...
  function TestValidate_PossibleFragmentSpreads_UnionIntoNonOverlappingUnion (line 134) | func TestValidate_PossibleFragmentSpreads_UnionIntoNonOverlappingUnion(t...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoNonImplementingObject (line 144) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoNonImplementingOb...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingInterface (line 153) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingInt...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingInterfaceInInlineFragment (line 164) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingInt...
  function TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingUnion (line 174) | func TestValidate_PossibleFragmentSpreads_InterfaceIntoNonOverlappingUni...

FILE: rules_provided_non_null_arguments_test.go
  function TestValidate_ProvidedNonNullArguments_IgnoresUnknownArguments (line 11) | func TestValidate_ProvidedNonNullArguments_IgnoresUnknownArguments(t *te...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_ArgOnOptionalArg (line 21) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_ArgOnOp...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_NoArgOnOptionalArg (line 30) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_NoArgOn...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_MultipleArgs (line 39) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_Multipl...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_MultipleArgsReverseOrder (line 48) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_Multipl...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_NoArgsOnMultipleOptional (line 57) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_NoArgsO...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_OneArgOnMultipleOptional (line 66) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_OneArgO...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_SecondArgOnMultipleOptional (line 75) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_SecondA...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_MultipleReqsOnMixedList (line 84) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_Multipl...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_MultipleReqsAndOneOptOnMixedList (line 93) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_Multipl...
  function TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_AllReqsAndOptsOnMixedList (line 102) | func TestValidate_ProvidedNonNullArguments_ValidNonNullableValue_AllReqs...
  function TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_MissingOneNonNullableArgument (line 112) | func TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_Missi...
  function TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_MissingMultipleNonNullableArguments (line 123) | func TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_Missi...
  function TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_IncorrectValueAndMissingArgument (line 135) | func TestValidate_ProvidedNonNullArguments_InvalidNonNullableValue_Incor...
  function TestValidate_ProvidedNonNullArguments_DirectiveArguments_IgnoresUnknownDirectives (line 147) | func TestValidate_ProvidedNonNullArguments_DirectiveArguments_IgnoresUnk...
  function TestValidate_ProvidedNonNullArguments_DirectiveArguments_WithDirectivesOfValidTypes (line 154) | func TestValidate_ProvidedNonNullArguments_DirectiveArguments_WithDirect...
  function TestValidate_ProvidedNonNullArguments_DirectiveArguments_WithDirectiveWithMissingTypes (line 166) | func TestValidate_ProvidedNonNullArguments_DirectiveArguments_WithDirect...

FILE: rules_scalar_leafs_test.go
  function TestValidate_ScalarLeafs_ValidScalarSelection (line 11) | func TestValidate_ScalarLeafs_ValidScalarSelection(t *testing.T) {
  function TestValidate_ScalarLeafs_ObjectTypeMissingSelection (line 18) | func TestValidate_ScalarLeafs_ObjectTypeMissingSelection(t *testing.T) {
  function TestValidate_ScalarLeafs_InterfaceTypeMissingSelection (line 27) | func TestValidate_ScalarLeafs_InterfaceTypeMissingSelection(t *testing.T) {
  function TestValidate_ScalarLeafs_ValidScalarSelectionWithArgs (line 36) | func TestValidate_ScalarLeafs_ValidScalarSelectionWithArgs(t *testing.T) {
  function TestValidate_ScalarLeafs_ScalarSelectionNotAllowedOnBoolean (line 44) | func TestValidate_ScalarLeafs_ScalarSelectionNotAllowedOnBoolean(t *test...
  function TestValidate_ScalarLeafs_ScalarSelectionNotAllowedOnEnum (line 53) | func TestValidate_ScalarLeafs_ScalarSelectionNotAllowedOnEnum(t *testing...
  function TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithArgs (line 62) | func TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithArgs(t *testi...
  function TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithDirectives (line 71) | func TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithDirectives(t ...
  function TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithDirectivesAndArgs (line 80) | func TestValidate_ScalarLeafs_ScalarSelectionNotAllowedWithDirectivesAnd...

FILE: rules_unique_argument_names_test.go
  function TestValidate_UniqueArgumentNames_NoArgumentsOnField (line 11) | func TestValidate_UniqueArgumentNames_NoArgumentsOnField(t *testing.T) {
  function TestValidate_UniqueArgumentNames_NoArgumentsOnDirective (line 18) | func TestValidate_UniqueArgumentNames_NoArgumentsOnDirective(t *testing....
  function TestValidate_UniqueArgumentNames_ArgumentOnField (line 25) | func TestValidate_UniqueArgumentNames_ArgumentOnField(t *testing.T) {
  function TestValidate_UniqueArgumentNames_ArgumentOnDirective (line 32) | func TestValidate_UniqueArgumentNames_ArgumentOnDirective(t *testing.T) {
  function TestValidate_UniqueArgumentNames_SameArgumentOnTwoFields (line 39) | func TestValidate_UniqueArgumentNames_SameArgumentOnTwoFields(t *testing...
  function TestValidate_UniqueArgumentNames_SameArgumentOnFieldAndDirective (line 47) | func TestValidate_UniqueArgumentNames_SameArgumentOnFieldAndDirective(t ...
  function TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives (line 54) | func TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives(t *tes...
  function TestValidate_UniqueArgumentNames_MultipleFieldArguments (line 61) | func TestValidate_UniqueArgumentNames_MultipleFieldArguments(t *testing....
  function TestValidate_UniqueArgumentNames_MultipleDirectiveArguments (line 68) | func TestValidate_UniqueArgumentNames_MultipleDirectiveArguments(t *test...
  function TestValidate_UniqueArgumentNames_DuplicateFieldArguments (line 75) | func TestValidate_UniqueArgumentNames_DuplicateFieldArguments(t *testing...
  function TestValidate_UniqueArgumentNames_ManyDuplicateFieldArguments (line 84) | func TestValidate_UniqueArgumentNames_ManyDuplicateFieldArguments(t *tes...
  function TestValidate_UniqueArgumentNames_DuplicateDirectiveArguments (line 94) | func TestValidate_UniqueArgumentNames_DuplicateDirectiveArguments(t *tes...
  function TestValidate_UniqueArgumentNames_ManyDuplicateDirectiveArguments (line 103) | func TestValidate_UniqueArgumentNames_ManyDuplicateDirectiveArguments(t ...

FILE: rules_unique_fragment_names_test.go
  function TestValidate_UniqueFragmentNames_NoFragments (line 11) | func TestValidate_UniqueFragmentNames_NoFragments(t *testing.T) {
  function TestValidate_UniqueFragmentNames_OneFragment (line 18) | func TestValidate_UniqueFragmentNames_OneFragment(t *testing.T) {
  function TestValidate_UniqueFragmentNames_ManyFragments (line 29) | func TestValidate_UniqueFragmentNames_ManyFragments(t *testing.T) {
  function TestValidate_UniqueFragmentNames_InlineFragmentsAreAlwaysUnique (line 47) | func TestValidate_UniqueFragmentNames_InlineFragmentsAreAlwaysUnique(t *...
  function TestValidate_UniqueFragmentNames_FragmentAndOperationNamedTheSame (line 59) | func TestValidate_UniqueFragmentNames_FragmentAndOperationNamedTheSame(t...
  function TestValidate_UniqueFragmentNames_FragmentsNamedTheSame (line 69) | func TestValidate_UniqueFragmentNames_FragmentsNamedTheSame(t *testing.T) {
  function TestValidate_UniqueFragmentNames_FragmentsNamedTheSameWithoutBeingReferenced (line 84) | func TestValidate_UniqueFragmentNames_FragmentsNamedTheSameWithoutBeingR...

FILE: rules_unique_input_field_names_test.go
  function TestValidate_UniqueInputFieldNames_InputObjectWithFields (line 11) | func TestValidate_UniqueInputFieldNames_InputObjectWithFields(t *testing...
  function TestValidate_UniqueInputFieldNames_SameInputObjectWithinTwoArgs (line 18) | func TestValidate_UniqueInputFieldNames_SameInputObjectWithinTwoArgs(t *...
  function TestValidate_UniqueInputFieldNames_MultipleInputObjectFields (line 25) | func TestValidate_UniqueInputFieldNames_MultipleInputObjectFields(t *tes...
  function TestValidate_UniqueInputFieldNames_AllowsForNestedInputObjectsWithSimilarFields (line 32) | func TestValidate_UniqueInputFieldNames_AllowsForNestedInputObjectsWithS...
  function TestValidate_UniqueInputFieldNames_DuplicateInputObjectFields (line 47) | func TestValidate_UniqueInputFieldNames_DuplicateInputObjectFields(t *te...
  function TestValidate_UniqueInputFieldNames_ManyDuplicateInputObjectFields (line 56) | func TestValidate_UniqueInputFieldNames_ManyDuplicateInputObjectFields(t...

FILE: rules_unique_operation_names_test.go
  function TestValidate_UniqueOperationNames_NoOperations (line 11) | func TestValidate_UniqueOperationNames_NoOperations(t *testing.T) {
  function TestValidate_UniqueOperationNames_OneAnonOperation (line 18) | func TestValidate_UniqueOperationNames_OneAnonOperation(t *testing.T) {
  function TestValidate_UniqueOperationNames_OneNamedOperation (line 25) | func TestValidate_UniqueOperationNames_OneNamedOperation(t *testing.T) {
  function TestValidate_UniqueOperationNames_MultipleOperations (line 32) | func TestValidate_UniqueOperationNames_MultipleOperations(t *testing.T) {
  function TestValidate_UniqueOperationNames_MultipleOperationsOfDifferentTypes (line 43) | func TestValidate_UniqueOperationNames_MultipleOperationsOfDifferentType...
  function TestValidate_UniqueOperationNames_FragmentAndOperationNamedTheSame (line 58) | func TestValidate_UniqueOperationNames_FragmentAndOperationNamedTheSame(...
  function TestValidate_UniqueOperationNames_MultipleOperationsOfSameName (line 68) | func TestValidate_UniqueOperationNames_MultipleOperationsOfSameName(t *t...
  function TestValidate_UniqueOperationNames_MultipleOperationsOfSameNameOfDifferentTypes_Mutation (line 80) | func TestValidate_UniqueOperationNames_MultipleOperationsOfSameNameOfDif...
  function TestValidate_UniqueOperationNames_MultipleOperationsOfSameNameOfDifferentTypes_Subscription (line 93) | func TestValidate_UniqueOperationNames_MultipleOperationsOfSameNameOfDif...
  function TestValidate_UniqueOperationNames_MultipleAnonymousOperations (line 106) | func TestValidate_UniqueOperationNames_MultipleAnonymousOperations(t *te...

FILE: rules_unique_variable_names_test.go
  function TestValidate_UniqueVariableNames_UniqueVariableNames (line 11) | func TestValidate_UniqueVariableNames_UniqueVariableNames(t *testing.T) {
  function TestValidate_UniqueVariableNames_DuplicateVariableNames (line 17) | func TestValidate_UniqueVariableNames_DuplicateVariableNames(t *testing....

FILE: rules_variables_are_input_types_test.go
  function TestValidate_VariablesAreInputTypes_ (line 11) | func TestValidate_VariablesAreInputTypes_(t *testing.T) {
  function TestValidate_VariablesAreInputTypes_1 (line 18) | func TestValidate_VariablesAreInputTypes_1(t *testing.T) {

FILE: rules_variables_in_allowed_position_test.go
  function TestValidate_VariablesInAllowedPosition_BooleanToBoolean (line 11) | func TestValidate_VariablesInAllowedPosition_BooleanToBoolean(t *testing...
  function TestValidate_VariablesInAllowedPosition_BooleanToBooleanWithinFragment (line 21) | func TestValidate_VariablesInAllowedPosition_BooleanToBooleanWithinFragm...
  function TestValidate_VariablesInAllowedPosition_NonNullableBooleanToBoolean (line 45) | func TestValidate_VariablesInAllowedPosition_NonNullableBooleanToBoolean...
  function TestValidate_VariablesInAllowedPosition_NonNullableBooleanToBooleanWithinFragment (line 55) | func TestValidate_VariablesInAllowedPosition_NonNullableBooleanToBoolean...
  function TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithDefault (line 69) | func TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithDefa...
  function TestValidate_VariablesInAllowedPosition_ListOfStringToListOfString (line 79) | func TestValidate_VariablesInAllowedPosition_ListOfStringToListOfString(...
  function TestValidate_VariablesInAllowedPosition_ListOfNonNullableStringToListOfString (line 89) | func TestValidate_VariablesInAllowedPosition_ListOfNonNullableStringToLi...
  function TestValidate_VariablesInAllowedPosition_StringToListOfStringInItemPosition (line 99) | func TestValidate_VariablesInAllowedPosition_StringToListOfStringInItemP...
  function TestValidate_VariablesInAllowedPosition_NonNullableStringToListOfStringInItemPosition (line 109) | func TestValidate_VariablesInAllowedPosition_NonNullableStringToListOfSt...
  function TestValidate_VariablesInAllowedPosition_ComplexInputToComplexInput (line 119) | func TestValidate_VariablesInAllowedPosition_ComplexInputToComplexInput(...
  function TestValidate_VariablesInAllowedPosition_ComplexInputToComplexInputInFieldPosition (line 129) | func TestValidate_VariablesInAllowedPosition_ComplexInputToComplexInputI...
  function TestValidate_VariablesInAllowedPosition_NonNullableBooleanToNonNullableBooleanInDirective (line 139) | func TestValidate_VariablesInAllowedPosition_NonNullableBooleanToNonNull...
  function TestValidate_VariablesInAllowedPosition_NonNullableBooleanToNonNullableBooleanInDirectiveInDirectiveWithDefault (line 147) | func TestValidate_VariablesInAllowedPosition_NonNullableBooleanToNonNull...
  function TestValidate_VariablesInAllowedPosition_IntToNonNullableInt (line 155) | func TestValidate_VariablesInAllowedPosition_IntToNonNullableInt(t *test...
  function TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithinFragment (line 167) | func TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithinFr...
  function TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithinNestedFragment (line 183) | func TestValidate_VariablesInAllowedPosition_IntToNonNullableIntWithinNe...
  function TestValidate_VariablesInAllowedPosition_StringOverBoolean (line 203) | func TestValidate_VariablesInAllowedPosition_StringOverBoolean(t *testin...
  function TestValidate_VariablesInAllowedPosition_StringToListOfString (line 215) | func TestValidate_VariablesInAllowedPosition_StringToListOfString(t *tes...
  function TestValidate_VariablesInAllowedPosition_BooleanToNonNullableBooleanInDirective (line 227) | func TestValidate_VariablesInAllowedPosition_BooleanToNonNullableBoolean...
  function TestValidate_VariablesInAllowedPosition_StringToNonNullableBooleanInDirective (line 237) | func TestValidate_VariablesInAllowedPosition_StringToNonNullableBooleanI...

FILE: scalars.go
  function coerceInt (line 17) | func coerceInt(value interface{}) interface{} {
  function coerceFloat (line 170) | func coerceFloat(value interface{}) interface{} {
  function coerceString (line 307) | func coerceString(value interface{}) interface{} {
  function coerceBool (line 334) | func coerceBool(value interface{}) interface{} {
  function serializeDateTime (line 514) | func serializeDateTime(value interface{}) interface{} {
  function unserializeDateTime (line 533) | func unserializeDateTime(value interface{}) interface{} {

FILE: scalars_parse_test.go
  function TestTypeSystem_Scalar_ParseValueOutputDateTime (line 12) | func TestTypeSystem_Scalar_ParseValueOutputDateTime(t *testing.T) {
  function TestTypeSystem_Scalar_ParseLiteralOutputDateTime (line 30) | func TestTypeSystem_Scalar_ParseLiteralOutputDateTime(t *testing.T) {

FILE: scalars_serialization_test.go
  type intSerializationTest (line 12) | type intSerializationTest struct
  type float64SerializationTest (line 17) | type float64SerializationTest struct
  type stringSerializationTest (line 22) | type stringSerializationTest struct
  type dateTimeSerializationTest (line 27) | type dateTimeSerializationTest struct
  type boolSerializationTest (line 32) | type boolSerializationTest struct
  function TestTypeSystem_Scalar_SerializesOutputInt (line 37) | func TestTypeSystem_Scalar_SerializesOutputInt(t *testing.T) {
  function TestTypeSystem_Scalar_SerializesOutputFloat (line 102) | func TestTypeSystem_Scalar_SerializesOutputFloat(t *testing.T) {
  function TestTypeSystem_Scalar_SerializesOutputStrings (line 134) | func TestTypeSystem_Scalar_SerializesOutputStrings(t *testing.T) {
  function TestTypeSystem_Scalar_SerializesOutputBoolean (line 153) | func TestTypeSystem_Scalar_SerializesOutputBoolean(t *testing.T) {
  function TestTypeSystem_Scalar_SerializeOutputDateTime (line 174) | func TestTypeSystem_Scalar_SerializeOutputDateTime(t *testing.T) {

FILE: scalars_test.go
  function TestCoerceInt (line 8) | func TestCoerceInt(t *testing.T) {
  function TestCoerceFloat (line 252) | func TestCoerceFloat(t *testing.T) {
  function TestCoerceBool (line 450) | func TestCoerceBool(t *testing.T) {
  function boolPtr (line 752) | func boolPtr(b bool) *bool {
  function intPtr (line 756) | func intPtr(n int) *int {
  function int8Ptr (line 760) | func int8Ptr(n int8) *int8 {
  function int16Ptr (line 764) | func int16Ptr(n int16) *int16 {
  function int32Ptr (line 768) | func int32Ptr(n int32) *int32 {
  function int64Ptr (line 772) | func int64Ptr(n int64) *int64 {
  function uintPtr (line 776) | func uintPtr(n uint) *uint {
  function uint8Ptr (line 780) | func uint8Ptr(n uint8) *uint8 {
  function uint16Ptr (line 784) | func uint16Ptr(n uint16) *uint16 {
  function uint32Ptr (line 788) | func uint32Ptr(n uint32) *uint32 {
  function uint64Ptr (line 792) | func uint64Ptr(n uint64) *uint64 {
  function float32Ptr (line 796) | func float32Ptr(n float32) *float32 {
  function float64Ptr (line 800) | func float64Ptr(n float64) *float64 {
  function stringPtr (line 804) | func stringPtr(s string) *string {

FILE: schema.go
  type SchemaConfig (line 3) | type SchemaConfig struct
  type TypeMap (line 12) | type TypeMap
  type Schema (line 34) | type Schema struct
    method AddImplementation (line 148) | func (gq *Schema) AddImplementation() error {
    method AppendType (line 184) | func (gq *Schema) AppendType(objectType Type) error {
    method QueryType (line 197) | func (gq *Schema) QueryType() *Object {
    method MutationType (line 201) | func (gq *Schema) MutationType() *Object {
    method SubscriptionType (line 205) | func (gq *Schema) SubscriptionType() *Object {
    method Directives (line 209) | func (gq *Schema) Directives() []*Directive {
    method Directive (line 213) | func (gq *Schema) Directive(name string) *Directive {
    method TypeMap (line 222) | func (gq *Schema) TypeMap() TypeMap {
    method Type (line 226) | func (gq *Schema) Type(name string) Type {
    method PossibleTypes (line 230) | func (gq *Schema) PossibleTypes(abstractType Abstract) []*Object {
    method IsPossibleType (line 241) | func (gq *Schema) IsPossibleType(abstractType Abstract, possibleType *...
    method AddExtensions (line 264) | func (gq *Schema) AddExtensions(e ...Extension) {
  function NewSchema (line 46) | func NewSchema(config SchemaConfig) (Schema, error) {
  function typeMapReducer (line 269) | func typeMapReducer(schema *Schema, typeMap TypeMap, objectType Type) (T...
  function assertObjectImplementsInterface (line 379) | func assertObjectImplementsInterface(schema *Schema, object *Object, ifa...
  function isEqualType (line 476) | func isEqualType(typeA Type, typeB Type) bool {
  function isTypeSubTypeOf (line 499) | func isTypeSubTypeOf(schema *Schema, maybeSubType Type, superType Type) ...

FILE: subscription.go
  type SubscribeParams (line 13) | type SubscribeParams struct
  function Subscribe (line 27) | func Subscribe(p Params) chan *Result {
  function sendOneResultAndClose (line 66) | func sendOneResultAndClose(res *Result) chan *Result {
  function ExecuteSubscription (line 75) | func ExecuteSubscription(p ExecuteParams) chan *Result {

FILE: subscription_test.go
  function TestSchemaSubscribe (line 12) | func TestSchemaSubscribe(t *testing.T) {
  function makeSubscribeToStringFunction (line 234) | func makeSubscribeToStringFunction(elements []string) func(p graphql.Res...
  function makeSubscribeToMapFunction (line 252) | func makeSubscribeToMapFunction(elements []map[string]interface{}) func(...
  function makeSubscriptionSchema (line 270) | func makeSubscriptionSchema(t *testing.T, c graphql.ObjectConfig) graphq...

FILE: suggested_list_internal_test.go
  function TestSuggestionList_ReturnsResultsWhenInputIsEmpty (line 8) | func TestSuggestionList_ReturnsResultsWhenInputIsEmpty(t *testing.T) {
  function TestSuggestionList_ReturnsEmptyArrayWhenThereAreNoOptions (line 15) | func TestSuggestionList_ReturnsEmptyArrayWhenThereAreNoOptions(t *testin...
  function TestSuggestionList_ReturnsOptionsSortedBasedOnSimilarity (line 22) | func TestSuggestionList_ReturnsOptionsSortedBasedOnSimilarity(t *testing...

FILE: testutil/rules_test_harness.go
  function init (line 15) | func init() {
  function expectValidRule (line 548) | func expectValidRule(t *testing.T, schema *graphql.Schema, rules []graph...
  function expectInvalidRule (line 565) | func expectInvalidRule(t *testing.T, schema *graphql.Schema, rules []gra...
  function ExpectPassesRule (line 594) | func ExpectPassesRule(t *testing.T, rule graphql.ValidationRuleFn, query...
  function ExpectFailsRule (line 597) | func ExpectFailsRule(t *testing.T, rule graphql.ValidationRuleFn, queryS...
  function ExpectFailsRuleWithSchema (line 600) | func ExpectFailsRuleWithSchema(t *testing.T, schema *graphql.Schema, rul...
  function ExpectPassesRuleWithSchema (line 603) | func ExpectPassesRuleWithSchema(t *testing.T, schema *graphql.Schema, ru...
  function RuleError (line 606) | func RuleError(message string, locs ...int) gqlerrors.FormattedError {

FILE: testutil/subscription.go
  type TestResponse (line 15) | type TestResponse struct
  type TestSubscription (line 21) | type TestSubscription struct
  function RunSubscribes (line 31) | func RunSubscribes(t *testing.T, tests []*TestSubscription) {
  function RunSubscribe (line 44) | func RunSubscribe(t *testing.T, test *TestSubscription) {
  function checkErrorStrings (line 106) | func checkErrorStrings(t *testing.T, expected, actual []string) {
  function formatJSON (line 131) | func formatJSON(data string) ([]byte, error) {
  function pretty (line 143) | func pretty(x interface{}) string {

FILE: testutil/testutil.go
  type StarWarsChar (line 32) | type StarWarsChar struct
  function init (line 41) | func init() {
  function GetHuman (line 330) | func GetHuman(id int) StarWarsChar {
  function GetDroid (line 336) | func GetDroid(id int) StarWarsChar {
  function GetHero (line 342) | func GetHero(episode interface{}) interface{} {
  function TestParse (line 351) | func TestParse(t *testing.T, query string) *ast.Document {
  function TestExecute (line 364) | func TestExecute(t *testing.T, ep graphql.ExecuteParams) *graphql.Result {
  function Diff (line 368) | func Diff(want, got interface{}) []string {
  function ASTToJSON (line 372) | func ASTToJSON(t *testing.T, a ast.Node) interface{} {
  function ContainSubsetSlice (line 385) | func ContainSubsetSlice(super []interface{}, sub []interface{}) bool {
  function ContainSubset (line 432) | func ContainSubset(super map[string]interface{}, sub map[string]interfac...
  function EqualErrorMessage (line 467) | func EqualErrorMessage(expected, result *graphql.Result, i int) bool {
  function EqualFormattedError (line 471) | func EqualFormattedError(exp, act gqlerrors.FormattedError) bool {
  function EqualFormattedErrors (line 487) | func EqualFormattedErrors(expected, actual []gqlerrors.FormattedError) b...
  function EqualResults (line 499) | func EqualResults(expected, result *graphql.Result) bool {

FILE: testutil/testutil_test.go
  function TestSubsetSlice_Simple (line 9) | func TestSubsetSlice_Simple(t *testing.T) {
  function TestSubsetSlice_Simple_Fail (line 21) | func TestSubsetSlice_Simple_Fail(t *testing.T) {
  function TestSubsetSlice_NestedSlice (line 33) | func TestSubsetSlice_NestedSlice(t *testing.T) {
  function TestSubsetSlice_NestedSlice_DifferentLength (line 61) | func TestSubsetSlice_NestedSlice_DifferentLength(t *testing.T) {
  function TestSubsetSlice_NestedSlice_Fail (line 86) | func TestSubsetSlice_NestedSlice_Fail(t *testing.T) {
  function TestSubset_Simple (line 115) | func TestSubset_Simple(t *testing.T) {
  function TestSubset_Simple_Fail (line 130) | func TestSubset_Simple_Fail(t *testing.T) {
  function TestSubset_NestedMap (line 145) | func TestSubset_NestedMap(t *testing.T) {
  function TestSubset_NestedMap_Fail (line 167) | func TestSubset_NestedMap_Fail(t *testing.T) {
  function TestSubset_NestedSlice (line 189) | func TestSubset_NestedSlice(t *testing.T) {
  function TestSubset_ComplexMixed (line 209) | func TestSubset_ComplexMixed(t *testing.T) {
  function TestSubset_ComplexMixed_Fail (line 258) | func TestSubset_ComplexMixed_Fail(t *testing.T) {

FILE: type_comparators_internal_test.go
  function TestIsEqualType_SameReferenceAreEqual (line 7) | func TestIsEqualType_SameReferenceAreEqual(t *testing.T) {
  function TestIsEqualType_IntAndFloatAreNotEqual (line 13) | func TestIsEqualType_IntAndFloatAreNotEqual(t *testing.T) {
  function TestIsEqualType_ListsOfSameTypeAreEqual (line 19) | func TestIsEqualType_ListsOfSameTypeAreEqual(t *testing.T) {
  function TestIsEqualType_ListsAreNotEqualToItem (line 25) | func TestIsEqualType_ListsAreNotEqualToItem(t *testing.T) {
  function TestIsEqualType_NonNullOfSameTypeAreEqual (line 31) | func TestIsEqualType_NonNullOfSameTypeAreEqual(t *testing.T) {
  function TestIsEqualType_NonNullIsNotEqualToNullable (line 36) | func TestIsEqualType_NonNullIsNotEqualToNullable(t *testing.T) {
  function testSchemaForIsTypeSubTypeOfTest (line 42) | func testSchemaForIsTypeSubTypeOfTest(t *testing.T, fields Fields) *Sche...
  function TestIsTypeSubTypeOf_SameReferenceIsSubtype (line 55) | func TestIsTypeSubTypeOf_SameReferenceIsSubtype(t *testing.T) {
  function TestIsTypeSubTypeOf_IntIsNotSubtypeOfFloat (line 63) | func TestIsTypeSubTypeOf_IntIsNotSubtypeOfFloat(t *testing.T) {
  function TestIsTypeSubTypeOf_NonNullIsSubtypeOfNullable (line 71) | func TestIsTypeSubTypeOf_NonNullIsSubtypeOfNullable(t *testing.T) {
  function TestIsTypeSubTypeOf_NullableIsNotSubtypeOfNonNull (line 79) | func TestIsTypeSubTypeOf_NullableIsNotSubtypeOfNonNull(t *testing.T) {
  function TestIsTypeSubTypeOf_ItemIsNotSubTypeOfList (line 87) | func TestIsTypeSubTypeOf_ItemIsNotSubTypeOfList(t *testing.T) {
  function TestIsTypeSubTypeOf_ListIsNotSubtypeOfItem (line 95) | func TestIsTypeSubTypeOf_ListIsNotSubtypeOfItem(t *testing.T) {
  function TestIsTypeSubTypeOf_MemberIsSubtypeOfUnion (line 104) | func TestIsTypeSubTypeOf_MemberIsSubtypeOfUnion(t *testing.T) {
  function TestIsTypeSubTypeOf_ImplementationIsSubtypeOfInterface (line 126) | func TestIsTypeSubTypeOf_ImplementationIsSubtypeOfInterface(t *testing.T) {

FILE: type_info.go
  type fieldDefFn (line 14) | type fieldDefFn
  type TypeInfo (line 16) | type TypeInfo struct
    method Type (line 47) | func (ti *TypeInfo) Type() Output {
    method ParentType (line 54) | func (ti *TypeInfo) ParentType() Composite {
    method InputType (line 61) | func (ti *TypeInfo) InputType() Input {
    method FieldDef (line 67) | func (ti *TypeInfo) FieldDef() *FieldDefinition {
    method Directive (line 74) | func (ti *TypeInfo) Directive() *Directive {
    method Argument (line 78) | func (ti *TypeInfo) Argument() *Argument {
    method Enter (line 82) | func (ti *TypeInfo) Enter(node ast.Node) {
    method Leave (line 190) | func (ti *TypeInfo) Leave(node ast.Node) {
  type TypeInfoConfig (line 27) | type TypeInfoConfig struct
  function NewTypeInfo (line 36) | func NewTypeInfo(opts *TypeInfoConfig) *TypeInfo {
  function DefaultTypeInfoFieldDef (line 236) | func DefaultTypeInfoFieldDef(schema *Schema, parentType Type, fieldAST *...

FILE: types.go
  type Result (line 10) | type Result struct
    method HasErrors (line 17) | func (r *Result) HasErrors() bool {

FILE: union_interface_test.go
  type testNamedType (line 12) | type testNamedType interface
  type testPet (line 14) | type testPet interface
  type testDog2 (line 16) | type testDog2 struct
  type testCat2 (line 21) | type testCat2 struct
  type testPerson (line 26) | type testPerson struct
  function TestUnionIntersectionTypes_CanIntrospectOnUnionAndIntersectionTypes (line 133) | func TestUnionIntersectionTypes_CanIntrospectOnUnionAndIntersectionTypes...
  function TestUnionIntersectionTypes_ExecutesUsingUnionTypes (line 215) | func TestUnionIntersectionTypes_ExecutesUsingUnionTypes(t *testing.T) {
  function TestUnionIntersectionTypes_ExecutesUnionTypesWithInlineFragments (line 264) | func TestUnionIntersectionTypes_ExecutesUnionTypesWithInlineFragments(t ...
  function TestUnionIntersectionTypes_ExecutesUsingInterfaceTypes (line 318) | func TestUnionIntersectionTypes_ExecutesUsingInterfaceTypes(t *testing.T) {
  function TestUnionIntersectionTypes_ExecutesInterfaceTypesWithInlineFragments (line 367) | func TestUnionIntersectionTypes_ExecutesInterfaceTypesWithInlineFragment...
  function TestUnionIntersectionTypes_AllowsFragmentConditionsToBeAbstractTypes (line 421) | func TestUnionIntersectionTypes_AllowsFragmentConditionsToBeAbstractType...
  function TestUnionIntersectionTypes_GetsExecutionInfoInResolver (line 500) | func TestUnionIntersectionTypes_GetsExecutionInfoInResolver(t *testing.T) {
  function TestUnionIntersectionTypes_ValueMayBeNilPointer (line 589) | func TestUnionIntersectionTypes_ValueMayBeNilPointer(t *testing.T) {

FILE: util.go
  constant TAG (line 10) | TAG = "json"
  function BindFields (line 18) | func BindFields(obj interface{}) Fields {
  function getGraphType (line 81) | func getGraphType(tipe reflect.Type) Output {
  function getGraphList (line 98) | func getGraphList(tipe reflect.Type) *List {
  function appendFields (line 121) | func appendFields(dest, origin Fields) Fields {
  function extractValue (line 128) | func extractValue(originTag string, obj interface{}) interface{} {
  function extractTag (line 155) | func extractTag(tag reflect.StructTag) string {
  function BindArg (line 164) | func BindArg(obj interface{}, tags ...string) FieldConfigArgument {
  function inArray (line 180) | func inArray(slice interface{}, item interface{}) bool {

FILE: util_test.go
  type Person (line 14) | type Person struct
  type Human (line 22) | type Human struct
  type Friend (line 29) | type Friend struct
  type Address (line 34) | type Address struct
  function TestBindFields (line 61) | func TestBindFields(t *testing.T) {
  function TestBindArg (line 121) | func TestBindArg(t *testing.T) {

FILE: validation_test.go
  function withModifiers (line 77) | func withModifiers(ttypes []graphql.Type) []graphql.Type {
  function schemaWithFieldType (line 106) | func schemaWithFieldType(ttype graphql.Output) (graphql.Schema, error) {
  function schemaWithInputObject (line 119) | func schemaWithInputObject(ttype graphql.Input) (graphql.Schema, error) {
  function schemaWithObjectFieldOfType (line 136) | func schemaWithObjectFieldOfType(fieldType graphql.Input) (graphql.Schem...
  function schemaWithObjectImplementingType (line 157) | func schemaWithObjectImplementingType(implementedType *graphql.Interface...
  function schemaWithUnionOfType (line 180) | func schemaWithUnionOfType(ttype *graphql.Object) (graphql.Schema, error) {
  function schemaWithInterfaceFieldOfType (line 200) | func schemaWithInterfaceFieldOfType(ttype graphql.Type) (graphql.Schema,...
  function schemaWithArgOfType (line 221) | func schemaWithArgOfType(ttype graphql.Type) (graphql.Schema, error) {
  function schemaWithInputFieldOfType (line 247) | func schemaWithInputFieldOfType(ttype graphql.Type) (graphql.Schema, err...
  function TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQueryTypeIsAnObjectType (line 274) | func TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQue...
  function TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQueryAndMutationTypesAreObjectType (line 282) | func TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQue...
  function TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQueryAndSubscriptionTypesAreObjectType (line 299) | func TestTypeSystem_SchemaMustHaveObjectRootTypes_AcceptsASchemaWhoseQue...
  function TestTypeSystem_SchemaMustHaveObjectRootTypes_RejectsASchemaWithoutAQueryType (line 316) | func TestTypeSystem_SchemaMustHaveObjectRootTypes_RejectsASchemaWithoutA...
  function TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWhichRedefinesABuiltInType (line 324) | func TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWh...
  function TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWhichDefinesAnObjectTypeTwice (line 351) | func TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWh...
  function TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWhichHaveSameNamedObjectsImplementingAnInterface (line 388) | func TestTypeSystem_SchemaMustContainUniquelyNamedTypes_RejectsASchemaWh...
  function TestTypeSystem_ObjectsMustHaveFields_AcceptsAnObjectTypeWithFieldsObject (line 441) | func TestTypeSystem_ObjectsMustHaveFields_AcceptsAnObjectTypeWithFieldsO...
  function TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithMissingFields (line 454) | func TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithMissing...
  function TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithIncorrectlyNamedFields (line 464) | func TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithIncorre...
  function TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithEmptyFields (line 479) | func TestTypeSystem_ObjectsMustHaveFields_RejectsAnObjectTypeWithEmptyFi...
  function TestTypeSystem_FieldsArgsMustBeProperlyNamed_AcceptsFieldArgsWithValidNames (line 491) | func TestTypeSystem_FieldsArgsMustBeProperlyNamed_AcceptsFieldArgsWithVa...
  function TestTypeSystem_FieldsArgsMustBeProperlyNamed_RejectsFieldArgWithInvalidNames (line 509) | func TestTypeSystem_FieldsArgsMustBeProperlyNamed_RejectsFieldArgWithInv...
  function TestTypeSystem_FieldsArgsMustBeObjects_AcceptsAnObjectTypeWithFieldArgs (line 529) | func TestTypeSystem_FieldsArgsMustBeObjects_AcceptsAnObjectTypeWithField...
  function TestTypeSystem_ObjectInterfacesMustBeArray_AcceptsAnObjectTypeWithArrayInterfaces (line 548) | func TestTypeSystem_ObjectInterfacesMustBeArray_AcceptsAnObjectTypeWithA...
  function TestTypeSystem_ObjectInterfacesMustBeArray_AcceptsAnObjectTypeWithInterfacesAsFunctionReturningAnArray (line 576) | func TestTypeSystem_ObjectInterfacesMustBeArray_AcceptsAnObjectTypeWithI...
  function TestTypeSystem_UnionTypesMustBeArray_AcceptsAUnionTypeWithArrayTypes (line 602) | func TestTypeSystem_UnionTypesMustBeArray_AcceptsAUnionTypeWithArrayType...
  function TestTypeSystem_UnionTypesMustBeArray_RejectsAUnionTypeWithoutTypes (line 616) | func TestTypeSystem_UnionTypesMustBeArray_RejectsAUnionTypeWithoutTypes(...
  function TestTypeSystem_UnionTypesMustBeArray_RejectsAUnionTypeWithEmptyTypes (line 628) | func TestTypeSystem_UnionTypesMustBeArray_RejectsAUnionTypeWithEmptyType...
  function TestTypeSystem_InputObjectsMustHaveFields_AcceptsAnInputObjectTypeWithFields (line 642) | func TestTypeSystem_InputObjectsMustHaveFields_AcceptsAnInputObjectTypeW...
  function TestTypeSystem_InputObjectsMustHaveFields_AcceptsAnInputObjectTypeWithAFieldFunction (line 656) | func TestTypeSystem_InputObjectsMustHaveFields_AcceptsAnInputObjectTypeW...
  function TestTypeSystem_InputObjectsMustHaveFields_RejectsAnInputObjectTypeWithMissingFields (line 672) | func TestTypeSystem_InputObjectsMustHaveFields_RejectsAnInputObjectTypeW...
  function TestTypeSystem_InputObjectsMustHaveFields_RejectsAnInputObjectTypeWithEmptyFields (line 681) | func TestTypeSystem_InputObjectsMustHaveFields_RejectsAnInputObjectTypeW...
  function TestTypeSystem_ObjectTypesMustBeAssertable_AcceptsAnObjectTypeWithAnIsTypeOfFunction (line 692) | func TestTypeSystem_ObjectTypesMustBeAssertable_AcceptsAnObjectTypeWithA...
  function TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceTypeDefiningResolveType (line 709) | func TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceTyp...
  function TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceWithImplementingTypeDefiningIsTypeOf (line 735) | func TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceWit...
  function TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceTypeDefiningResolveTypeWithImplementingTypeDefiningIsTypeOf (line 762) | func TestTypeSystem_InterfaceTypesMustBeResolvable_AcceptsAnInterfaceTyp...
  function TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionTypeDefiningResolveType (line 792) | func TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionTypeDefining...
  function TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionOfObjectTypesDefiningIsTypeOf (line 805) | func TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionOfObjectType...
  function TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionTypeDefiningResolveTypeOfObjectTypesDefiningIsTypeOf (line 815) | func TestTypeSystem_UnionTypesMustBeResolvable_AcceptsAUnionTypeDefining...
  function TestTypeSystem_UnionTypesMustBeResolvable_RejectsAUnionTypeNotDefiningResolveTypeOfObjectTypesNotDefiningIsTypeOf (line 828) | func TestTypeSystem_UnionTypesMustBeResolvable_RejectsAUnionTypeNotDefin...
  function TestTypeSystem_ScalarTypesMustBeSerializable_AcceptsAScalarTypeDefiningSerialize (line 842) | func TestTypeSystem_ScalarTypesMustBeSerializable_AcceptsAScalarTypeDefi...
  function TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeNotDefiningSerialize (line 854) | func TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeNotD...
  function TestTypeSystem_ScalarTypesMustBeSerializable_AcceptsAScalarTypeDefiningParseValueAndParseLiteral (line 866) | func TestTypeSystem_ScalarTypesMustBeSerializable_AcceptsAScalarTypeDefi...
  function TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeDefiningParseValueButNotParseLiteral (line 884) | func TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeDefi...
  function TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeDefiningParseLiteralButNotParseValue (line 900) | func TestTypeSystem_ScalarTypesMustBeSerializable_RejectsAScalarTypeDefi...
  function TestTypeSystem_EnumTypesMustBeWellDefined_AcceptsAWellDefinedEnumTypeWithEmptyValueDefinition (line 917) | func TestTypeSystem_EnumTypesMustBeWellDefined_AcceptsAWellDefinedEnumTy...
  function TestTypeSystem_EnumTypesMustBeWellDefined_AcceptsAWellDefinedEnumTypeWithInternalValueDefinition (line 930) | func TestTypeSystem_EnumTypesMustBeWellDefined_AcceptsAWellDefinedEnumTy...
  function TestTypeSystem_EnumTypesMustBeWellDefined_RejectsAnEnumTypeWithoutValues (line 947) | func TestTypeSystem_EnumTypesMustBeWellDefined_RejectsAnEnumTypeWithoutV...
  function TestTypeSystem_EnumTypesMustBeWellDefined_RejectsAnEnumTypeWithEmptyValues (line 957) | func TestTypeSystem_EnumTypesMustBeWellDefined_RejectsAnEnumTypeWithEmpt...
  function TestTypeSystem_ObjectFieldsMustHaveOutputTypes_AcceptAnOutputTypeAsAnObjectFieldType (line 969) | func TestTypeSystem_ObjectFieldsMustHaveOutputTypes_AcceptAnOutputTypeAs...
  function TestTypeSystem_ObjectFieldsMustHaveOutputTypes_RejectsAnEmptyObjectFieldType (line 977) | func TestTypeSystem_ObjectFieldsMustHaveOutputTypes_RejectsAnEmptyObject...
  function TestTypeSystem_ObjectsCanOnlyImplementInterfaces_AcceptsAnObjectImplementingAnInterface (line 985) | func TestTypeSystem_ObjectsCanOnlyImplementInterfaces_AcceptsAnObjectImp...
  function TestTypeSystem_ObjectsCanOnlyImplementInterfaces_RejectsAnObjectImplementingANonInterfaceType (line 1002) | func TestTypeSystem_ObjectsCanOnlyImplementInterfaces_RejectsAnObjectImp...
  function TestTypeSystem_UnionsMustRepresentObjectTypes_AcceptsAUnionOfAnObjectType (line 1010) | func TestTypeSystem_UnionsMustRepresentObjectTypes_AcceptsAUnionOfAnObje...
  function TestTypeSystem_UnionsMustRepresentObjectTypes_RejectsAUnionOfNonObjectTypes (line 1016) | func TestTypeSystem_UnionsMustRepresentObjectTypes_RejectsAUnionOfNonObj...
  function TestTypeSystem_InterfaceFieldsMustHaveOutputTypes_AcceptsAnOutputTypeAsAnInterfaceFieldType (line 1024) | func TestTypeSystem_InterfaceFieldsMustHaveOutputTypes_AcceptsAnOutputTy...
  function TestTypeSystem_InterfaceFieldsMustHaveOutputTypes_RejectsAnEmptyInterfaceFieldType (line 1032) | func TestTypeSystem_InterfaceFieldsMustHaveOutputTypes_RejectsAnEmptyInt...
  function TestTypeSystem_FieldArgumentsMustHaveInputTypes_AcceptsAnInputTypeAsFieldArgType (line 1040) | func TestTypeSystem_FieldArgumentsMustHaveInputTypes_AcceptsAnInputTypeA...
  function TestTypeSystem_FieldArgumentsMustHaveInputTypes_RejectsAnEmptyFieldArgType (line 1048) | func TestTypeSystem_FieldArgumentsMustHaveInputTypes_RejectsAnEmptyField...
  function TestTypeSystem_InputObjectFieldsMustHaveInputTypes_A
Condensed preview — 137 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,325K chars).
[
  {
    "path": ".circleci/config.yml",
    "chars": 1215,
    "preview": "test_with_go_modules: &test_with_go_modules\n  steps:\n    - checkout\n    - run: go test ./...\n    - run: go vet ./...\n\nte"
  },
  {
    "path": ".gitignore",
    "chars": 15,
    "preview": ".DS_Store\n.idea"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 6028,
    "preview": "# Contributing to graphql\n\nThis document is based on the [Node.js contribution guidelines](https://github.com/nodejs/nod"
  },
  {
    "path": "LICENSE",
    "chars": 1078,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Chris Ramón\n\nPermission is hereby granted, free of charge, to any person obtai"
  },
  {
    "path": "README.md",
    "chars": 3768,
    "preview": "# graphql [![CircleCI](https://circleci.com/gh/graphql-go/graphql/tree/master.svg?style=svg)](https://circleci.com/gh/gr"
  },
  {
    "path": "abstract_test.go",
    "chars": 14084,
    "preview": "package graphql_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/g"
  },
  {
    "path": "benchutil/list_schema.go",
    "chars": 2231,
    "preview": "package benchutil\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\ntype color struct {\n\tHex string\n\tR   int\n\tG   in"
  },
  {
    "path": "benchutil/wide_schema.go",
    "chars": 2954,
    "preview": "package benchutil\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\nfunc WideSchemaWithXFieldsAndYItems(x int, y int"
  },
  {
    "path": "definition.go",
    "chars": 33927,
    "preview": "package graphql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n)\n\n// Ty"
  },
  {
    "path": "definition_test.go",
    "chars": 25308,
    "preview": "package graphql_test\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/gr"
  },
  {
    "path": "directives.go",
    "chars": 4713,
    "preview": "package graphql\n\nconst (\n\t// Operations\n\tDirectiveLocationQuery              = \"QUERY\"\n\tDirectiveLocationMutation       "
  },
  {
    "path": "directives_test.go",
    "chars": 13688,
    "preview": "package graphql_test\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gq"
  },
  {
    "path": "enum_type_test.go",
    "chars": 13096,
    "preview": "package graphql_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/g"
  },
  {
    "path": "examples/concurrent-resolvers/main.go",
    "chars": 2068,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\ntype Foo struct {\n\tName strin"
  },
  {
    "path": "examples/context/main.go",
    "chars": 1565,
    "preview": "package main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\nvar Sc"
  },
  {
    "path": "examples/crud/Readme.md",
    "chars": 829,
    "preview": "# Go GraphQL CRUD example\n\nImplement create, read, update and delete on Go.\n\nTo run the program:\n\n1. go to the directory"
  },
  {
    "path": "examples/crud/main.go",
    "chars": 6123,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\n// "
  },
  {
    "path": "examples/custom-scalar-type/main.go",
    "chars": 2760,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/"
  },
  {
    "path": "examples/hello-world/main.go",
    "chars": 894,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\nfunc main() {\n\t// Schema\n\tfie"
  },
  {
    "path": "examples/http/data.json",
    "chars": 144,
    "preview": "{\n  \"1\": {\n    \"id\": \"1\",\n    \"name\": \"Dan\"\n  },\n  \"2\": {\n    \"id\": \"2\",\n    \"name\": \"Lee\"\n  },\n  \"3\": {\n    \"id\": \"3\",\n"
  },
  {
    "path": "examples/http/main.go",
    "chars": 2740,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\ntype user s"
  },
  {
    "path": "examples/http-post/main.go",
    "chars": 1809,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/gra"
  },
  {
    "path": "examples/httpdynamic/README.md",
    "chars": 1143,
    "preview": "Basically, if we have `data.json` like this:\n\n    [\n      { \"id\": \"1\", \"name\": \"Dan\" },\n      { \"id\": \"2\", \"name\": \"Lee\""
  },
  {
    "path": "examples/httpdynamic/data.json",
    "chars": 154,
    "preview": "[\n  {\n    \"id\": \"1\",\n    \"name\": \"Dan\",\n    \"surname\": \"Jones\"\n  },\n  {\n    \"id\": \"2\",\n    \"name\": \"Lee\"\n  },\n  {\n    \"i"
  },
  {
    "path": "examples/httpdynamic/main.go",
    "chars": 2938,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strconv\"\n\t\"syscall\"\n\n\t\"gith"
  },
  {
    "path": "examples/modify-context/main.go",
    "chars": 1820,
    "preview": "package main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\ntype User struct {"
  },
  {
    "path": "examples/sql-nullstring/README.md",
    "chars": 1196,
    "preview": "# Go GraphQL SQL null string example\r\n\r\n<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://golang.org/pkg/databa"
  },
  {
    "path": "examples/sql-nullstring/main.go",
    "chars": 5620,
    "preview": "package main\r\n\r\nimport (\r\n\t\"database/sql\"\r\n\t\"encoding/json\"\r\n\t\"fmt\"\r\n\t\"github.com/graphql-go/graphql\"\r\n\t\"github.com/grap"
  },
  {
    "path": "examples/star-wars/main.go",
    "chars": 602,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/gra"
  },
  {
    "path": "examples/todo/README.md",
    "chars": 963,
    "preview": "# Go GraphQL ToDo example\n\nAn example that consists of basic core GraphQL queries and mutations.\n\nTo run the example nav"
  },
  {
    "path": "examples/todo/main.go",
    "chars": 1770,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"gith"
  },
  {
    "path": "examples/todo/schema/schema.go",
    "chars": 4798,
    "preview": "package schema\n\nimport (\n\t\"math/rand\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\nvar TodoList []Todo\n\ntype Todo struct {\n\tID  "
  },
  {
    "path": "examples/todo/static/assets/css/style.css",
    "chars": 122,
    "preview": "body {\n    background-color: #cccccc;\n    color: #333333;\n    font-family: sans-serif;\n}\n\n.todo-done {\n    opacity: 0.5;"
  },
  {
    "path": "examples/todo/static/assets/js/app.js",
    "chars": 2151,
    "preview": "var updateTodo = function(id, isDone){\n  $.ajax({\n    url: '/graphql?query=mutation+_{updateTodo(id:\"' + id + '\",done:' "
  },
  {
    "path": "examples/todo/static/index.html",
    "chars": 1362,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>ToDo</title>\n  <link rel=\"stylesheet\" type=\"text/css\" hr"
  },
  {
    "path": "executor.go",
    "chars": 32586,
    "preview": "package graphql\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/graphql-go/graphql/gql"
  },
  {
    "path": "executor_resolve_test.go",
    "chars": 7169,
    "preview": "package graphql_test\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/testuti"
  },
  {
    "path": "executor_schema_test.go",
    "chars": 7093,
    "preview": "package graphql_test\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/gr"
  },
  {
    "path": "executor_test.go",
    "chars": 55461,
    "preview": "package graphql_test\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/"
  },
  {
    "path": "extensions.go",
    "chars": 8239,
    "preview": "package graphql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n)\n\ntype (\n\t// ParseFinishFunc is"
  },
  {
    "path": "extensions_test.go",
    "chars": 12198,
    "preview": "package graphql_test\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"git"
  },
  {
    "path": "go.mod",
    "chars": 46,
    "preview": "module github.com/graphql-go/graphql\n\ngo 1.13\n"
  },
  {
    "path": "gqlerrors/error.go",
    "chars": 2076,
    "preview": "package gqlerrors\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/graphql-go/gra"
  },
  {
    "path": "gqlerrors/formatted.go",
    "chars": 1546,
    "preview": "package gqlerrors\n\nimport (\n\t\"errors\"\n\n\t\"github.com/graphql-go/graphql/language/location\"\n)\n\ntype ExtendedError interfac"
  },
  {
    "path": "gqlerrors/located.go",
    "chars": 786,
    "preview": "package gqlerrors\n\nimport (\n\t\"errors\"\n\t\"github.com/graphql-go/graphql/language/ast\"\n)\n\n// NewLocatedError creates a grap"
  },
  {
    "path": "gqlerrors/sortutil.go",
    "chars": 723,
    "preview": "package gqlerrors\n\nimport \"bytes\"\n\ntype FormattedErrors []FormattedError\n\nfunc (errs FormattedErrors) Len() int {\n\tretur"
  },
  {
    "path": "gqlerrors/syntax.go",
    "chars": 1930,
    "preview": "package gqlerrors\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/grap"
  },
  {
    "path": "graphql.go",
    "chars": 2907,
    "preview": "package graphql\n\nimport (\n\t\"context\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graphql/languag"
  },
  {
    "path": "graphql_bench_test.go",
    "chars": 2407,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/benchutil\"\n)"
  },
  {
    "path": "graphql_test.go",
    "chars": 6422,
    "preview": "package graphql_test\n\nimport (\n\t\"context\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-g"
  },
  {
    "path": "introspection.go",
    "chars": 22983,
    "preview": "package graphql\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/graphql-"
  },
  {
    "path": "introspection_test.go",
    "chars": 38214,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "kitchen-sink.graphql",
    "chars": 823,
    "preview": "# Filename: kitchen-sink.graphql\n\nquery namedQuery($foo: ComplexFooType, $bar: Bar = DefaultBarValue) {\n  customUser: us"
  },
  {
    "path": "language/ast/arguments.go",
    "chars": 430,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\n// Argument implements Node\ntype Argument struc"
  },
  {
    "path": "language/ast/definitions.go",
    "chars": 5522,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\ntype Definition interface {\n\tGetOperation() str"
  },
  {
    "path": "language/ast/directives.go",
    "chars": 547,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\n// Directive implements Node\ntype Directive str"
  },
  {
    "path": "language/ast/document.go",
    "chars": 500,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\n// Document implements Node\ntype Document struc"
  },
  {
    "path": "language/ast/location.go",
    "chars": 317,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/source\"\n)\n\ntype Location struct {\n\tStart  int\n\tEnd    int"
  },
  {
    "path": "language/ast/name.go",
    "chars": 391,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\n// Name implements Node\ntype Name struct {\n\tKin"
  },
  {
    "path": "language/ast/node.go",
    "chars": 1440,
    "preview": "package ast\n\ntype Node interface {\n\tGetKind() string\n\tGetLoc() *Location\n}\n\n// The list of all possible AST node graphql"
  },
  {
    "path": "language/ast/selections.go",
    "chars": 2537,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\ntype Selection interface {\n\tGetSelectionSet() *"
  },
  {
    "path": "language/ast/type_definitions.go",
    "chars": 11824,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\n// DescribableNode are nodes that have descript"
  },
  {
    "path": "language/ast/types.go",
    "chars": 1460,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\ntype Type interface {\n\tGetKind() string\n\tGetLoc"
  },
  {
    "path": "language/ast/values.go",
    "chars": 4965,
    "preview": "package ast\n\nimport (\n\t\"github.com/graphql-go/graphql/language/kinds\"\n)\n\ntype Value interface {\n\tGetValue() interface{}\n"
  },
  {
    "path": "language/kinds/kinds.go",
    "chars": 1817,
    "preview": "package kinds\n\nconst (\n\t// Name\n\tName = \"Name\"\n\n\t// Document\n\tDocument            = \"Document\"\n\tOperationDefinition = \"O"
  },
  {
    "path": "language/lexer/lexer.go",
    "chars": 16824,
    "preview": "package lexer\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\""
  },
  {
    "path": "language/lexer/lexer_test.go",
    "chars": 19227,
    "preview": "package lexer\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/language/source\"\n)\n\ntype Test struct {\n\tB"
  },
  {
    "path": "language/location/location.go",
    "chars": 696,
    "preview": "package location\n\nimport (\n\t\"regexp\"\n\n\t\"github.com/graphql-go/graphql/language/source\"\n)\n\ntype SourceLocation struct {\n\t"
  },
  {
    "path": "language/parser/parser.go",
    "chars": 38462,
    "preview": "package parser\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graphql/language/ast"
  },
  {
    "path": "language/parser/parser_test.go",
    "chars": 18146,
    "preview": "package parser\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors"
  },
  {
    "path": "language/parser/schema_parser_test.go",
    "chars": 21155,
    "preview": "package parser\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graph"
  },
  {
    "path": "language/printer/printer.go",
    "chars": 29770,
    "preview": "package printer\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"reflect\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"gith"
  },
  {
    "path": "language/printer/printer_test.go",
    "chars": 4911,
    "preview": "package printer_test\n\nimport (\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"githu"
  },
  {
    "path": "language/printer/schema_printer_test.go",
    "chars": 5336,
    "preview": "package printer_test\n\nimport (\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"githu"
  },
  {
    "path": "language/source/source.go",
    "chars": 225,
    "preview": "package source\n\nconst (\n\tname = \"GraphQL\"\n)\n\ntype Source struct {\n\tBody []byte\n\tName string\n}\n\nfunc NewSource(s *Source)"
  },
  {
    "path": "language/typeInfo/type_info.go",
    "chars": 212,
    "preview": "package typeInfo\n\nimport (\n\t\"github.com/graphql-go/graphql/language/ast\"\n)\n\n// TypeInfoI defines the interface for TypeI"
  },
  {
    "path": "language/visitor/visitor.go",
    "chars": 18320,
    "preview": "package visitor\n\nimport (\n\t\"fmt\"\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/graphql-go/graphql/language/"
  },
  {
    "path": "language/visitor/visitor_test.go",
    "chars": 66930,
    "preview": "package visitor_test\n\nimport (\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com"
  },
  {
    "path": "lists_test.go",
    "chars": 22022,
    "preview": "package graphql_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/g"
  },
  {
    "path": "located.go",
    "chars": 1079,
    "preview": "package graphql\n\nimport (\n\t\"errors\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graphql/language"
  },
  {
    "path": "mutations_test.go",
    "chars": 6648,
    "preview": "package graphql_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/g"
  },
  {
    "path": "nonnull_test.go",
    "chars": 26990,
    "preview": "package graphql_test\n\nimport (\n\t\"sort\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqle"
  },
  {
    "path": "quoted_or_list_internal_test.go",
    "chars": 991,
    "preview": "package graphql\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestQuotedOrList_DoesNoAcceptAnEmptyList(t *testing.T) {\n\texpect"
  },
  {
    "path": "race_test.go",
    "chars": 1187,
    "preview": "package graphql_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestRace(t *testing.T) "
  },
  {
    "path": "rules.go",
    "chars": 56843,
    "preview": "package graphql\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"git"
  },
  {
    "path": "rules_arguments_of_correct_type_test.go",
    "chars": 23874,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_default_values_of_correct_type_test.go",
    "chars": 3663,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_fields_on_correct_type_test.go",
    "chars": 8988,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_fragments_on_composite_types_test.go",
    "chars": 2900,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_known_argument_names_test.go",
    "chars": 4510,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_known_directives_rule_test.go",
    "chars": 5360,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_known_fragment_names_test.go",
    "chars": 1337,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_known_type_names_test.go",
    "chars": 1634,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_lone_anonymous_operation_rule_test.go",
    "chars": 2232,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_no_fragment_cycles_test.go",
    "chars": 6368,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_no_undefined_variables_test.go",
    "chars": 8218,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_no_unused_fragments_test.go",
    "chars": 3216,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_no_unused_variables_test.go",
    "chars": 5289,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_overlapping_fields_can_be_merged.go",
    "chars": 25344,
    "preview": "package graphql\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/graphql-go/graph"
  },
  {
    "path": "rules_overlapping_fields_can_be_merged_test.go",
    "chars": 27070,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_possible_fragment_spreads_test.go",
    "chars": 8400,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_provided_non_null_arguments_test.go",
    "chars": 5747,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_scalar_leafs_test.go",
    "chars": 3220,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_unique_argument_names_test.go",
    "chars": 3636,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_unique_fragment_names_test.go",
    "chars": 2259,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_unique_input_field_names_test.go",
    "chars": 1956,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_unique_operation_names_test.go",
    "chars": 2909,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_unique_variable_names_test.go",
    "chars": 1074,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_variables_are_input_types_test.go",
    "chars": 918,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "rules_variables_in_allowed_position_test.go",
    "chars": 8227,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "scalars.go",
    "chars": 11096,
    "preview": "package graphql\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql/language/ast\"\n)\n\n// As per "
  },
  {
    "path": "scalars_parse_test.go",
    "chars": 1423,
    "preview": "package graphql_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/g"
  },
  {
    "path": "scalars_serialization_test.go",
    "chars": 4980,
    "preview": "package graphql_test\n\nimport (\n\t\"math\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\ntype intSerial"
  },
  {
    "path": "scalars_test.go",
    "chars": 10244,
    "preview": "package graphql\n\nimport (\n\t\"math\"\n\t\"testing\"\n)\n\nfunc TestCoerceInt(t *testing.T) {\n\ttests := []struct {\n\t\tin   interface"
  },
  {
    "path": "schema-all-descriptions.graphql",
    "chars": 2105,
    "preview": "# File: schema-all-descriptions.graphql\n\n\"\"\"single line scalar description\"\"\"\nscalar ScalarSingleLine\n\n\"\"\"\nmulti line\n\ns"
  },
  {
    "path": "schema-kitchen-sink.graphql",
    "chars": 1300,
    "preview": "# Filename: schema-kitchen-sink.graphql\n\nschema {\n  query: QueryType\n  mutation: MutationType\n}\n\ntype Foo implements Bar"
  },
  {
    "path": "schema.go",
    "chars": 14722,
    "preview": "package graphql\n\ntype SchemaConfig struct {\n\tQuery        *Object\n\tMutation     *Object\n\tSubscription *Object\n\tTypes    "
  },
  {
    "path": "subscription.go",
    "chars": 5365,
    "preview": "package graphql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graphql/"
  },
  {
    "path": "subscription_test.go",
    "chars": 6862,
    "preview": "package graphql_test\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/gra"
  },
  {
    "path": "suggested_list_internal_test.go",
    "chars": 821,
    "preview": "package graphql\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestSuggestionList_ReturnsResultsWhenInputIsEmpty(t *testing.T) "
  },
  {
    "path": "testutil/introspection_query.go",
    "chars": 1596,
    "preview": "package testutil\n\nvar IntrospectionQuery = `\n  query IntrospectionQuery {\n    __schema {\n      queryType { name }\n      "
  },
  {
    "path": "testutil/rules_test_harness.go",
    "chars": 16208,
    "preview": "package testutil\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"git"
  },
  {
    "path": "testutil/subscription.go",
    "chars": 3259,
    "preview": "package testutil\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/graphql-go"
  },
  {
    "path": "testutil/testutil.go",
    "chars": 13103,
    "preview": "package testutil\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\""
  },
  {
    "path": "testutil/testutil_test.go",
    "chars": 5146,
    "preview": "package testutil_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql/testutil\"\n)\n\nfunc TestSubsetSlice_Simple(t *"
  },
  {
    "path": "type_comparators_internal_test.go",
    "chars": 4047,
    "preview": "package graphql\n\nimport (\n\t\"testing\"\n)\n\nfunc TestIsEqualType_SameReferenceAreEqual(t *testing.T) {\n\tif !isEqualType(Stri"
  },
  {
    "path": "type_info.go",
    "chars": 7821,
    "preview": "package graphql\n\nimport (\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"github.com/graphql-go/graphql/language/kinds\"\n"
  },
  {
    "path": "types.go",
    "chars": 537,
    "preview": "package graphql\n\nimport (\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n)\n\n// type Schema interface{}\n\n// Result has the re"
  },
  {
    "path": "union_interface_test.go",
    "chars": 14432,
    "preview": "package graphql_test\n\nimport (\n\t\"context\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-g"
  },
  {
    "path": "util.go",
    "chars": 3886,
    "preview": "package graphql\n\nimport (\n\t\"encoding\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nconst TAG = \"json\"\n\n// can't take recursive slice "
  },
  {
    "path": "util_test.go",
    "chars": 4158,
    "preview": "package graphql_test\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/graphql-go/graphql\"\n\t"
  },
  {
    "path": "validation_test.go",
    "chars": 49399,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/language/ast"
  },
  {
    "path": "validator.go",
    "chars": 8780,
    "preview": "package graphql\n\nimport (\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t\"github.com/graphql-go/graphql/language/ast\"\n\t\"git"
  },
  {
    "path": "validator_test.go",
    "chars": 2564,
    "preview": "package graphql_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/graphql-go/graphql/gqlerrors\"\n\t"
  },
  {
    "path": "values.go",
    "chars": 11716,
    "preview": "package graphql\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/graphql-go/graphql"
  },
  {
    "path": "values_test.go",
    "chars": 461,
    "preview": "package graphql\n\nimport \"testing\"\n\nfunc TestIsIterable(t *testing.T) {\n\tif !isIterable([]int{}) {\n\t\tt.Fatal(\"expected is"
  },
  {
    "path": "variables_test.go",
    "chars": 37183,
    "preview": "package graphql_test\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/graphql-go/graphql\"\n\t\"github.com/gra"
  }
]

About this extraction

This page contains the full source code of the graphql-go/graphql GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 137 files (1.1 MB), approximately 321.7k tokens, and a symbol index with 1839 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!