forked from graph-gophers/graphql-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move GraphQL types to package ast (graph-gophers#584)
- Loading branch information
1 parent
945d196
commit 7ddb8a6
Showing
41 changed files
with
670 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
// Argument is a representation of the GraphQL Argument. | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Package ast represents all types from the [GraphQL specification] in code. | ||
The names of the Go types, whenever possible, match 1:1 with the names from | ||
the specification. | ||
[GraphQL specification]: https://spec.graphql.org | ||
*/ | ||
package ast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package ast | ||
|
||
// Schema represents a GraphQL service's collective type system capabilities. | ||
// A schema is defined in terms of the types and directives it supports as well as the root | ||
// operation types for each kind of operation: `query`, `mutation`, and `subscription`. | ||
// | ||
// For a more formal definition, read the relevant section in the specification: | ||
// | ||
// http://spec.graphql.org/draft/#sec-Schema | ||
type Schema struct { | ||
// RootOperationTypes determines the place in the type system where `query`, `mutation`, and | ||
// `subscription` operations begin. | ||
// | ||
// http://spec.graphql.org/draft/#sec-Root-Operation-Types | ||
// | ||
RootOperationTypes map[string]NamedType | ||
|
||
// Types are the fundamental unit of any GraphQL schema. | ||
// There are six kinds of named type definitions in GraphQL, and two wrapping types. | ||
// | ||
// http://spec.graphql.org/draft/#sec-Types | ||
Types map[string]NamedType | ||
|
||
// Directives are used to annotate various parts of a GraphQL document as an indicator that they | ||
// should be evaluated differently by a validator, executor, or client tool such as a code | ||
// generator. | ||
// | ||
// http://spec.graphql.org/#sec-Type-System.Directives | ||
Directives map[string]*DirectiveDefinition | ||
|
||
EntryPointNames map[string]string | ||
Objects []*ObjectTypeDefinition | ||
Unions []*Union | ||
Enums []*EnumTypeDefinition | ||
Extensions []*Extension | ||
SchemaString string | ||
} | ||
|
||
func (s *Schema) Resolve(name string) Type { | ||
return s.Types[name] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import ( | ||
"github.com/graph-gophers/graphql-go/errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import ( | ||
"strconv" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package types | ||
package ast | ||
|
||
import "github.com/graph-gophers/graphql-go/errors" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.