1package schema
2
3var Meta *Schema
4
5func init() {
6 Meta = &Schema{} // bootstrap
7 Meta = New()
8 if err := Meta.Parse(metaSrc); err != nil {
9 panic(err)
10 }
11}
12
13var metaSrc = `
14 # The ` + "`" + `Int` + "`" + ` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
15 scalar Int
16
17 # The ` + "`" + `Float` + "`" + ` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).
18 scalar Float
19
20 # The ` + "`" + `String` + "`" + ` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
21 scalar String
22
23 # The ` + "`" + `Boolean` + "`" + ` scalar type represents ` + "`" + `true` + "`" + ` or ` + "`" + `false` + "`" + `.
24 scalar Boolean
25
26 # The ` + "`" + `ID` + "`" + ` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as ` + "`" + `"4"` + "`" + `) or integer (such as ` + "`" + `4` + "`" + `) input value will be accepted as an ID.
27 scalar ID
28
29 # The ` + "`" + `Map` + "`" + ` scalar type is a simple json object
30 scalar Map
31
32 # Directs the executor to include this field or fragment only when the ` + "`" + `if` + "`" + ` argument is true.
33 directive @include(
34 # Included when true.
35 if: Boolean!
36 ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
37
38 # Directs the executor to skip this field or fragment when the ` + "`" + `if` + "`" + ` argument is true.
39 directive @skip(
40 # Skipped when true.
41 if: Boolean!
42 ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
43
44 # Marks an element of a GraphQL schema as no longer supported.
45 directive @deprecated(
46 # Explains why this element was deprecated, usually also including a suggestion
47 # for how to access supported similar data. Formatted in
48 # [Markdown](https://daringfireball.net/projects/markdown/).
49 reason: String = "No longer supported"
50 ) on FIELD_DEFINITION | ENUM_VALUE
51
52 # A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
53 #
54 # In some cases, you need to provide options to alter GraphQL's execution behavior
55 # in ways field arguments will not suffice, such as conditionally including or
56 # skipping a field. Directives provide this by describing additional information
57 # to the executor.
58 type __Directive {
59 name: String!
60 description: String
61 locations: [__DirectiveLocation!]!
62 args: [__InputValue!]!
63 }
64
65 # A Directive can be adjacent to many parts of the GraphQL language, a
66 # __DirectiveLocation describes one such possible adjacencies.
67 enum __DirectiveLocation {
68 # Location adjacent to a query operation.
69 QUERY
70 # Location adjacent to a mutation operation.
71 MUTATION
72 # Location adjacent to a subscription operation.
73 SUBSCRIPTION
74 # Location adjacent to a field.
75 FIELD
76 # Location adjacent to a fragment definition.
77 FRAGMENT_DEFINITION
78 # Location adjacent to a fragment spread.
79 FRAGMENT_SPREAD
80 # Location adjacent to an inline fragment.
81 INLINE_FRAGMENT
82 # Location adjacent to a schema definition.
83 SCHEMA
84 # Location adjacent to a scalar definition.
85 SCALAR
86 # Location adjacent to an object type definition.
87 OBJECT
88 # Location adjacent to a field definition.
89 FIELD_DEFINITION
90 # Location adjacent to an argument definition.
91 ARGUMENT_DEFINITION
92 # Location adjacent to an interface definition.
93 INTERFACE
94 # Location adjacent to a union definition.
95 UNION
96 # Location adjacent to an enum definition.
97 ENUM
98 # Location adjacent to an enum value definition.
99 ENUM_VALUE
100 # Location adjacent to an input object type definition.
101 INPUT_OBJECT
102 # Location adjacent to an input object field definition.
103 INPUT_FIELD_DEFINITION
104 }
105
106 # One possible value for a given Enum. Enum values are unique values, not a
107 # placeholder for a string or numeric value. However an Enum value is returned in
108 # a JSON response as a string.
109 type __EnumValue {
110 name: String!
111 description: String
112 isDeprecated: Boolean!
113 deprecationReason: String
114 }
115
116 # Object and Interface types are described by a list of Fields, each of which has
117 # a name, potentially a list of arguments, and a return type.
118 type __Field {
119 name: String!
120 description: String
121 args: [__InputValue!]!
122 type: __Type!
123 isDeprecated: Boolean!
124 deprecationReason: String
125 }
126
127 # Arguments provided to Fields or Directives and the input fields of an
128 # InputObject are represented as Input Values which describe their type and
129 # optionally a default value.
130 type __InputValue {
131 name: String!
132 description: String
133 type: __Type!
134 # A GraphQL-formatted string representing the default value for this input value.
135 defaultValue: String
136 }
137
138 # A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all
139 # available types and directives on the server, as well as the entry points for
140 # query, mutation, and subscription operations.
141 type __Schema {
142 # A list of all types supported by this server.
143 types: [__Type!]!
144 # The type that query operations will be rooted at.
145 queryType: __Type!
146 # If this server supports mutation, the type that mutation operations will be rooted at.
147 mutationType: __Type
148 # If this server support subscription, the type that subscription operations will be rooted at.
149 subscriptionType: __Type
150 # A list of all directives supported by this server.
151 directives: [__Directive!]!
152 }
153
154 # The fundamental unit of any GraphQL Schema is the type. There are many kinds of
155 # types in GraphQL as represented by the ` + "`" + `__TypeKind` + "`" + ` enum.
156 #
157 # Depending on the kind of a type, certain fields describe information about that
158 # type. Scalar types provide no information beyond a name and description, while
159 # Enum types provide their values. Object and Interface types provide the fields
160 # they describe. Abstract types, Union and Interface, provide the Object types
161 # possible at runtime. List and NonNull types compose other types.
162 type __Type {
163 kind: __TypeKind!
164 name: String
165 description: String
166 fields(includeDeprecated: Boolean = false): [__Field!]
167 interfaces: [__Type!]
168 possibleTypes: [__Type!]
169 enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
170 inputFields: [__InputValue!]
171 ofType: __Type
172 }
173
174 # An enum describing what kind of type a given ` + "`" + `__Type` + "`" + ` is.
175 enum __TypeKind {
176 # Indicates this type is a scalar.
177 SCALAR
178 # Indicates this type is an object. ` + "`" + `fields` + "`" + ` and ` + "`" + `interfaces` + "`" + ` are valid fields.
179 OBJECT
180 # Indicates this type is an interface. ` + "`" + `fields` + "`" + ` and ` + "`" + `possibleTypes` + "`" + ` are valid fields.
181 INTERFACE
182 # Indicates this type is a union. ` + "`" + `possibleTypes` + "`" + ` is a valid field.
183 UNION
184 # Indicates this type is an enum. ` + "`" + `enumValues` + "`" + ` is a valid field.
185 ENUM
186 # Indicates this type is an input object. ` + "`" + `inputFields` + "`" + ` is a valid field.
187 INPUT_OBJECT
188 # Indicates this type is a list. ` + "`" + `ofType` + "`" + ` is a valid field.
189 LIST
190 # Indicates this type is a non-null. ` + "`" + `ofType` + "`" + ` is a valid field.
191 NON_NULL
192 }
193`