on 51c7eb7 help sign in
145 lines 2.0 kB history raw
1# Token::
2# Punctuator
3# Name
4# IntValue
5# FloatValue
6# StringValue
8# Punctuator:: one of
9# ! $ ( ) ... : = @ [ ] { | }
11# Name::
12# /[_A-Za-z][_0-9A-Za-z]*/
14# Document :
15# Definition (list)
17# Definition :
18# ExecutableDefinition
19# TypeSystemDefinition
20# TypeSystemExtension
22# ExecutableDefinition :
23# FragmentDefinition
24# OperationDefintion
26# FragmentDefinition
28type someType {
29 id: ID
32fragment subsriberFields on someType {
33 id
34 name
35 fooInt(int: 1234, negInt: -56789, zero: 0)
36 fooFloat(
37 float: 1.1
38 floatExp: 1.4e10
39 floatExpSign1: 1.4e+10
40 floatExpSign2: 1.5e-40
41 floatExpBigE: 1.5E10
42 )
43 fooBool(x: true, y: false)
44 fooString(str: "hello", strUni: "\u2116", strEscWs: "\t")
45 fooLongStr(
46 lStr: """
47 Hello Reader,
48 This is a long string block.
49 Best,
50 Writer
51 """
52 )
53 fooNull(nullThing: null)
54 fooList(numList: [1, 2, 3], strList: ["a", "b", "c"])
55 fooObj(someObj: { str: "hi", int: 2 })
58# OperationDefintion
60query _A1 {
61 getThings(strArg: "string") {
62 id # commas here are ignored but valid
63 name
64 }
67query _A2($x: String) {
68 someFn(episode: $x) {
69 name
70 }
73mutation B1 {
74 changeThings(intArg: 123) {
75 parent {
76 nestedField1
77 nestedField2
78 }
79 }
82subscription C1_Hello {
83 subsribePlease(floatArg: 1.4) {
84 id
85 ...subsriberFields
86 }
89# TypeSystemDefinition :
90# SchemaDefinition
91# TypeDefinition
93schema {
94 query: Query
95 mutation: Mutation
98type Query {
99 """
100 Can provide documentation this way.
101 """
102 scalars: Scalars
103 someList: SomeLists
104 fooBar: FooBar
107interface Thing {
108 id: ID!
111type Scalars implements Thing {
112 id: ID!
113 int: Int!
114 float: Float!
115 str: String! @deprecated(reason: "Need to test a directive")
116 bool: Boolean
117 type: StringTypes
120type SomeLists {
121 ints: [Int!]!
124type Foo {
125 fooVal: String
128type Bar {
129 barVal: String
132union FooBar = Foo | Bar
134enum StringTypes {
135 ONE
136 TWO
139input Xyz {
140 id: ID!
143type Mutation {
144 createXyz(input: xyz!): Xyz!