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