...
1directive @goTag(
2 key: String!
3 value: String
4) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
5
6directive @goField(
7 forceResolver: Boolean
8 name: String
9 omittable: Boolean
10) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION | INTERFACE
11
12type Query {
13 thisShoudlntGetGenerated: Boolean
14}
15
16type Mutation {
17 thisShoudlntGetGenerated: Boolean
18}
19
20type Subscription {
21 thisShoudlntGetGenerated: Boolean
22}
23
24type MissingTypeNotNull implements MissingInterface & ExistingInterface {
25 name: String!
26 enum: MissingEnum!
27 int: MissingInterface!
28 existing: ExistingType!
29 missing2: MissingTypeNullable!
30}
31
32type MissingTypeNullable implements MissingInterface & ExistingInterface {
33 name: String
34 enum: MissingEnum
35 int: MissingInterface
36 existing: ExistingType
37 missing2: MissingTypeNotNull
38}
39
40input MissingInput {
41 name: String
42 enum: MissingEnum
43 nonNullString: String!
44 nullString: String @goField(omittable: true)
45 nullEnum: MissingEnum @goField(omittable: true)
46 nullObject: ExistingInput @goField(omittable: true)
47}
48
49enum MissingEnum {
50 Hello
51 Goodbye
52}
53
54interface MissingInterface {
55 name: String
56}
57
58union MissingUnion = MissingTypeNotNull | MissingTypeNullable | ExistingType
59
60type ExistingType implements MissingInterface & ExistingInterface {
61 name: String
62 enum: ExistingEnum
63 int: ExistingInterface
64 existing: MissingTypeNullable
65}
66
67input ExistingInput {
68 name: String
69 enum: ExistingEnum
70}
71
72type FieldMutationHook {
73 name: String @goTag(key :"anotherTag", value: "tag")
74 enum: ExistingEnum @goTag(key: "yetAnotherTag", value: "12")
75 noVal: String @goTag(key: "yaml") @goTag(key : "repeated", value: "true")
76 repeated: String @goTag(key: "someTag", value: "value") @goTag(key : "repeated", value: "true")
77
78}
79
80enum ExistingEnum {
81 Hello
82 Goodbye
83}
84
85interface ExistingInterface {
86 name: String
87}
88
89union ExistingUnion = MissingTypeNotNull | MissingTypeNullable | ExistingType
90
91"TypeWithDescription is a type with a description"
92type TypeWithDescription {
93 name: String
94}
95
96"EnumWithDescription is an enum with a description"
97enum EnumWithDescription {
98 CAT
99 DOG
100}
101
102"InterfaceWithDescription is an interface with a description"
103interface InterfaceWithDescription {
104 name: String
105}
106
107"UnionWithDescription is an union with a description"
108union UnionWithDescription = TypeWithDescription | ExistingType
109
110
111interface Foo_Barer {
112 name: String!
113}
114
115type _Foo_Barr implements Foo_Barer {
116 name: String!
117}
118
119# https://spec.graphql.org/October2021/#sec-Interfaces
120interface A {
121 a: String!
122}
123
124interface B {
125 b: Int!
126}
127
128interface C implements A {
129 a: String!
130 c: Boolean!
131}
132
133interface D implements A & B {
134 a: String!
135 b: Int!
136 d: String
137}
138
139type CDImplemented implements C & D & A & B {
140 a: String!
141 b: Int!
142 c: Boolean!
143 d: String
144}
145
146type CyclicalA {
147 field_one: CyclicalB
148 field_two: CyclicalB
149 field_three: CyclicalB
150 field_four: String!
151}
152
153type CyclicalB {
154 field_one: CyclicalA
155 field_two: CyclicalA
156 field_three: CyclicalA
157 field_four: CyclicalA
158 field_five: String!
159}
160
161type NotCyclicalA {
162 FieldOne: String!
163 FieldTwo: Int!
164}
165
166type NotCyclicalB {
167 FieldOne: String!
168 FieldTwo: NotCyclicalA!
169}
170
171type Recursive {
172 FieldOne: Recursive!
173 FieldTwo: Recursive!
174 FieldThree: Recursive!
175 FieldFour: String!
176}
177
178type RenameFieldTest {
179 badName: String!
180 otherField: String!
181}
182
183interface ArrayOfA {
184 trickyField: [A!]!
185 trickyFieldPointer: [A]
186}
187
188type ImplArrayOfA implements ArrayOfA {
189 trickyField: [CDImplemented!]!
190 trickyFieldPointer: [CDImplemented]
191}
192
193interface X {
194 Id: String! @goField(name: "Id")
195}
196
197type Xer implements X {
198 Id: String! @goField(name: "Id")
199 Name: String!
200}
201
202type ExtraFieldsTest {
203 SchemaField: String!
204}
205
206type OmitEmptyJsonTagTest {
207 ValueNonNil: String!
208 Value: String
209}
View as plain text