github.com/Desuuuu/genqlient@v0.5.3/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go (about) 1 // Code generated by github.com/Desuuuu/genqlient, DO NOT EDIT. 2 3 package test 4 5 import ( 6 "encoding/json" 7 "fmt" 8 9 "github.com/Desuuuu/genqlient/graphql" 10 "github.com/Desuuuu/genqlient/internal/testutil" 11 ) 12 13 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContent includes the requested fields of the GraphQL interface Content. 14 // 15 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContent is implemented by the following types: 16 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle 17 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo 18 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic 19 // The GraphQL type's documentation follows. 20 // 21 // Content is implemented by various types like Article, Video, and Topic. 22 type InterfaceListOfListOfListsFieldListOfListsOfListsOfContent interface { 23 implementsGraphQLInterfaceInterfaceListOfListOfListsFieldListOfListsOfListsOfContent() 24 // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). 25 GetTypename() string 26 // GetId returns the interface-field "id" from its implementation. 27 // The GraphQL interface field's documentation follows. 28 // 29 // ID is the identifier of the content. 30 GetId() testutil.ID 31 // GetName returns the interface-field "name" from its implementation. 32 GetName() string 33 GetContentArticle() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle, bool) 34 GetContentVideo() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo, bool) 35 GetContentTopic() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic, bool) 36 } 37 38 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldListOfListsOfListsOfContent() { 39 } 40 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetContentArticle() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle, bool) { 41 return v, true 42 } 43 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetContentVideo() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo, bool) { 44 return nil, false 45 } 46 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetContentTopic() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic, bool) { 47 return nil, false 48 } 49 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldListOfListsOfListsOfContent() { 50 } 51 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetContentArticle() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle, bool) { 52 return nil, false 53 } 54 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetContentVideo() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo, bool) { 55 return v, true 56 } 57 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetContentTopic() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic, bool) { 58 return nil, false 59 } 60 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldListOfListsOfListsOfContent() { 61 } 62 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetContentArticle() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle, bool) { 63 return nil, false 64 } 65 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetContentVideo() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo, bool) { 66 return nil, false 67 } 68 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetContentTopic() (*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic, bool) { 69 return v, true 70 } 71 72 func __unmarshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent(b []byte, v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContent) error { 73 if string(b) == "null" { 74 return nil 75 } 76 77 var tn struct { 78 TypeName string `json:"__typename"` 79 } 80 err := json.Unmarshal(b, &tn) 81 if err != nil { 82 return err 83 } 84 85 switch tn.TypeName { 86 case "Article": 87 *v = new(InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) 88 return json.Unmarshal(b, *v) 89 case "Video": 90 *v = new(InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) 91 return json.Unmarshal(b, *v) 92 case "Topic": 93 *v = new(InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) 94 return json.Unmarshal(b, *v) 95 case "": 96 return fmt.Errorf( 97 "response was missing Content.__typename") 98 default: 99 return fmt.Errorf( 100 `unexpected concrete type for InterfaceListOfListOfListsFieldListOfListsOfListsOfContent: "%v"`, tn.TypeName) 101 } 102 } 103 104 func __marshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent(v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContent) ([]byte, error) { 105 106 var typename string 107 switch v := (*v).(type) { 108 case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle: 109 typename = "Article" 110 111 result := struct { 112 TypeName string `json:"__typename"` 113 *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle 114 }{typename, v} 115 return json.Marshal(result) 116 case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo: 117 typename = "Video" 118 119 result := struct { 120 TypeName string `json:"__typename"` 121 *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo 122 }{typename, v} 123 return json.Marshal(result) 124 case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic: 125 typename = "Topic" 126 127 result := struct { 128 TypeName string `json:"__typename"` 129 *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic 130 }{typename, v} 131 return json.Marshal(result) 132 case nil: 133 return []byte("null"), nil 134 default: 135 return nil, fmt.Errorf( 136 `unexpected concrete type for InterfaceListOfListOfListsFieldListOfListsOfListsOfContent: "%T"`, v) 137 } 138 } 139 140 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle includes the requested fields of the GraphQL type Article. 141 type InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle struct { 142 Typename string `json:"__typename"` 143 // ID is the identifier of the content. 144 Id testutil.ID `json:"id"` 145 Name string `json:"name"` 146 } 147 148 // GetTypename returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle.Typename, and is useful for accessing the field via an interface. 149 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetTypename() string { 150 return v.Typename 151 } 152 153 // GetId returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle.Id, and is useful for accessing the field via an interface. 154 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetId() testutil.ID { 155 return v.Id 156 } 157 158 // GetName returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle.Name, and is useful for accessing the field via an interface. 159 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle) GetName() string { 160 return v.Name 161 } 162 163 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic includes the requested fields of the GraphQL type Topic. 164 type InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic struct { 165 Typename string `json:"__typename"` 166 // ID is the identifier of the content. 167 Id testutil.ID `json:"id"` 168 Name string `json:"name"` 169 } 170 171 // GetTypename returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic.Typename, and is useful for accessing the field via an interface. 172 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetTypename() string { 173 return v.Typename 174 } 175 176 // GetId returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic.Id, and is useful for accessing the field via an interface. 177 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetId() testutil.ID { 178 return v.Id 179 } 180 181 // GetName returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic.Name, and is useful for accessing the field via an interface. 182 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic) GetName() string { 183 return v.Name 184 } 185 186 // InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo includes the requested fields of the GraphQL type Video. 187 type InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo struct { 188 Typename string `json:"__typename"` 189 // ID is the identifier of the content. 190 Id testutil.ID `json:"id"` 191 Name string `json:"name"` 192 } 193 194 // GetTypename returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo.Typename, and is useful for accessing the field via an interface. 195 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetTypename() string { 196 return v.Typename 197 } 198 199 // GetId returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo.Id, and is useful for accessing the field via an interface. 200 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetId() testutil.ID { 201 return v.Id 202 } 203 204 // GetName returns InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo.Name, and is useful for accessing the field via an interface. 205 func (v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo) GetName() string { 206 return v.Name 207 } 208 209 // InterfaceListOfListOfListsFieldResponse is returned by InterfaceListOfListOfListsField on success. 210 type InterfaceListOfListOfListsFieldResponse struct { 211 ListOfListsOfListsOfContent [][][]InterfaceListOfListOfListsFieldListOfListsOfListsOfContent `json:"-"` 212 WithPointer [][][]*InterfaceListOfListOfListsFieldWithPointerContent `json:"-"` 213 } 214 215 // GetListOfListsOfListsOfContent returns InterfaceListOfListOfListsFieldResponse.ListOfListsOfListsOfContent, and is useful for accessing the field via an interface. 216 func (v *InterfaceListOfListOfListsFieldResponse) GetListOfListsOfListsOfContent() [][][]InterfaceListOfListOfListsFieldListOfListsOfListsOfContent { 217 return v.ListOfListsOfListsOfContent 218 } 219 220 // GetWithPointer returns InterfaceListOfListOfListsFieldResponse.WithPointer, and is useful for accessing the field via an interface. 221 func (v *InterfaceListOfListOfListsFieldResponse) GetWithPointer() [][][]*InterfaceListOfListOfListsFieldWithPointerContent { 222 return v.WithPointer 223 } 224 225 func (v *InterfaceListOfListOfListsFieldResponse) UnmarshalJSON(b []byte) error { 226 227 if string(b) == "null" { 228 return nil 229 } 230 231 var firstPass struct { 232 *InterfaceListOfListOfListsFieldResponse 233 ListOfListsOfListsOfContent [][][]json.RawMessage `json:"listOfListsOfListsOfContent"` 234 WithPointer [][][]json.RawMessage `json:"withPointer"` 235 graphql.NoUnmarshalJSON 236 } 237 firstPass.InterfaceListOfListOfListsFieldResponse = v 238 239 err := json.Unmarshal(b, &firstPass) 240 if err != nil { 241 return err 242 } 243 244 { 245 dst := &v.ListOfListsOfListsOfContent 246 src := firstPass.ListOfListsOfListsOfContent 247 *dst = make( 248 [][][]InterfaceListOfListOfListsFieldListOfListsOfListsOfContent, 249 len(src)) 250 for i, src := range src { 251 dst := &(*dst)[i] 252 *dst = make( 253 [][]InterfaceListOfListOfListsFieldListOfListsOfListsOfContent, 254 len(src)) 255 for i, src := range src { 256 dst := &(*dst)[i] 257 *dst = make( 258 []InterfaceListOfListOfListsFieldListOfListsOfListsOfContent, 259 len(src)) 260 for i, src := range src { 261 dst := &(*dst)[i] 262 if len(src) != 0 && string(src) != "null" { 263 err = __unmarshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent( 264 src, dst) 265 if err != nil { 266 return fmt.Errorf( 267 "Unable to unmarshal InterfaceListOfListOfListsFieldResponse.ListOfListsOfListsOfContent: %w", err) 268 } 269 } 270 } 271 } 272 } 273 } 274 275 { 276 dst := &v.WithPointer 277 src := firstPass.WithPointer 278 *dst = make( 279 [][][]*InterfaceListOfListOfListsFieldWithPointerContent, 280 len(src)) 281 for i, src := range src { 282 dst := &(*dst)[i] 283 *dst = make( 284 [][]*InterfaceListOfListOfListsFieldWithPointerContent, 285 len(src)) 286 for i, src := range src { 287 dst := &(*dst)[i] 288 *dst = make( 289 []*InterfaceListOfListOfListsFieldWithPointerContent, 290 len(src)) 291 for i, src := range src { 292 dst := &(*dst)[i] 293 if len(src) != 0 && string(src) != "null" { 294 *dst = new(InterfaceListOfListOfListsFieldWithPointerContent) 295 err = __unmarshalInterfaceListOfListOfListsFieldWithPointerContent( 296 src, *dst) 297 if err != nil { 298 return fmt.Errorf( 299 "Unable to unmarshal InterfaceListOfListOfListsFieldResponse.WithPointer: %w", err) 300 } 301 } 302 } 303 } 304 } 305 } 306 return nil 307 } 308 309 type __premarshalInterfaceListOfListOfListsFieldResponse struct { 310 ListOfListsOfListsOfContent [][][]json.RawMessage `json:"listOfListsOfListsOfContent"` 311 312 WithPointer [][][]json.RawMessage `json:"withPointer"` 313 } 314 315 func (v *InterfaceListOfListOfListsFieldResponse) MarshalJSON() ([]byte, error) { 316 premarshaled, err := v.__premarshalJSON() 317 if err != nil { 318 return nil, err 319 } 320 return json.Marshal(premarshaled) 321 } 322 323 func (v *InterfaceListOfListOfListsFieldResponse) __premarshalJSON() (*__premarshalInterfaceListOfListOfListsFieldResponse, error) { 324 var retval __premarshalInterfaceListOfListOfListsFieldResponse 325 326 { 327 328 dst := &retval.ListOfListsOfListsOfContent 329 src := v.ListOfListsOfListsOfContent 330 *dst = make( 331 [][][]json.RawMessage, 332 len(src)) 333 for i, src := range src { 334 dst := &(*dst)[i] 335 *dst = make( 336 [][]json.RawMessage, 337 len(src)) 338 for i, src := range src { 339 dst := &(*dst)[i] 340 *dst = make( 341 []json.RawMessage, 342 len(src)) 343 for i, src := range src { 344 dst := &(*dst)[i] 345 var err error 346 *dst, err = __marshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent( 347 &src) 348 if err != nil { 349 return nil, fmt.Errorf( 350 "Unable to marshal InterfaceListOfListOfListsFieldResponse.ListOfListsOfListsOfContent: %w", err) 351 } 352 } 353 } 354 } 355 } 356 { 357 358 dst := &retval.WithPointer 359 src := v.WithPointer 360 *dst = make( 361 [][][]json.RawMessage, 362 len(src)) 363 for i, src := range src { 364 dst := &(*dst)[i] 365 *dst = make( 366 [][]json.RawMessage, 367 len(src)) 368 for i, src := range src { 369 dst := &(*dst)[i] 370 *dst = make( 371 []json.RawMessage, 372 len(src)) 373 for i, src := range src { 374 dst := &(*dst)[i] 375 if src != nil { 376 var err error 377 *dst, err = __marshalInterfaceListOfListOfListsFieldWithPointerContent( 378 src) 379 if err != nil { 380 return nil, fmt.Errorf( 381 "Unable to marshal InterfaceListOfListOfListsFieldResponse.WithPointer: %w", err) 382 } 383 } 384 } 385 } 386 } 387 } 388 return &retval, nil 389 } 390 391 // InterfaceListOfListOfListsFieldWithPointerArticle includes the requested fields of the GraphQL type Article. 392 type InterfaceListOfListOfListsFieldWithPointerArticle struct { 393 Typename string `json:"__typename"` 394 // ID is the identifier of the content. 395 Id *testutil.ID `json:"id"` 396 Name *string `json:"name"` 397 } 398 399 // GetTypename returns InterfaceListOfListOfListsFieldWithPointerArticle.Typename, and is useful for accessing the field via an interface. 400 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetTypename() string { return v.Typename } 401 402 // GetId returns InterfaceListOfListOfListsFieldWithPointerArticle.Id, and is useful for accessing the field via an interface. 403 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetId() *testutil.ID { return v.Id } 404 405 // GetName returns InterfaceListOfListOfListsFieldWithPointerArticle.Name, and is useful for accessing the field via an interface. 406 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetName() *string { return v.Name } 407 408 // InterfaceListOfListOfListsFieldWithPointerContent includes the requested fields of the GraphQL interface Content. 409 // 410 // InterfaceListOfListOfListsFieldWithPointerContent is implemented by the following types: 411 // InterfaceListOfListOfListsFieldWithPointerArticle 412 // InterfaceListOfListOfListsFieldWithPointerVideo 413 // InterfaceListOfListOfListsFieldWithPointerTopic 414 // The GraphQL type's documentation follows. 415 // 416 // Content is implemented by various types like Article, Video, and Topic. 417 type InterfaceListOfListOfListsFieldWithPointerContent interface { 418 implementsGraphQLInterfaceInterfaceListOfListOfListsFieldWithPointerContent() 419 // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). 420 GetTypename() string 421 // GetId returns the interface-field "id" from its implementation. 422 // The GraphQL interface field's documentation follows. 423 // 424 // ID is the identifier of the content. 425 GetId() *testutil.ID 426 // GetName returns the interface-field "name" from its implementation. 427 GetName() *string 428 GetContentArticle() (*InterfaceListOfListOfListsFieldWithPointerArticle, bool) 429 GetContentVideo() (*InterfaceListOfListOfListsFieldWithPointerVideo, bool) 430 GetContentTopic() (*InterfaceListOfListOfListsFieldWithPointerTopic, bool) 431 } 432 433 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldWithPointerContent() { 434 } 435 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetContentArticle() (*InterfaceListOfListOfListsFieldWithPointerArticle, bool) { 436 return v, true 437 } 438 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetContentVideo() (*InterfaceListOfListOfListsFieldWithPointerVideo, bool) { 439 return nil, false 440 } 441 func (v *InterfaceListOfListOfListsFieldWithPointerArticle) GetContentTopic() (*InterfaceListOfListOfListsFieldWithPointerTopic, bool) { 442 return nil, false 443 } 444 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldWithPointerContent() { 445 } 446 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetContentArticle() (*InterfaceListOfListOfListsFieldWithPointerArticle, bool) { 447 return nil, false 448 } 449 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetContentVideo() (*InterfaceListOfListOfListsFieldWithPointerVideo, bool) { 450 return v, true 451 } 452 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetContentTopic() (*InterfaceListOfListOfListsFieldWithPointerTopic, bool) { 453 return nil, false 454 } 455 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) implementsGraphQLInterfaceInterfaceListOfListOfListsFieldWithPointerContent() { 456 } 457 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetContentArticle() (*InterfaceListOfListOfListsFieldWithPointerArticle, bool) { 458 return nil, false 459 } 460 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetContentVideo() (*InterfaceListOfListOfListsFieldWithPointerVideo, bool) { 461 return nil, false 462 } 463 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetContentTopic() (*InterfaceListOfListOfListsFieldWithPointerTopic, bool) { 464 return v, true 465 } 466 467 func __unmarshalInterfaceListOfListOfListsFieldWithPointerContent(b []byte, v *InterfaceListOfListOfListsFieldWithPointerContent) error { 468 if string(b) == "null" { 469 return nil 470 } 471 472 var tn struct { 473 TypeName string `json:"__typename"` 474 } 475 err := json.Unmarshal(b, &tn) 476 if err != nil { 477 return err 478 } 479 480 switch tn.TypeName { 481 case "Article": 482 *v = new(InterfaceListOfListOfListsFieldWithPointerArticle) 483 return json.Unmarshal(b, *v) 484 case "Video": 485 *v = new(InterfaceListOfListOfListsFieldWithPointerVideo) 486 return json.Unmarshal(b, *v) 487 case "Topic": 488 *v = new(InterfaceListOfListOfListsFieldWithPointerTopic) 489 return json.Unmarshal(b, *v) 490 case "": 491 return fmt.Errorf( 492 "response was missing Content.__typename") 493 default: 494 return fmt.Errorf( 495 `unexpected concrete type for InterfaceListOfListOfListsFieldWithPointerContent: "%v"`, tn.TypeName) 496 } 497 } 498 499 func __marshalInterfaceListOfListOfListsFieldWithPointerContent(v *InterfaceListOfListOfListsFieldWithPointerContent) ([]byte, error) { 500 501 var typename string 502 switch v := (*v).(type) { 503 case *InterfaceListOfListOfListsFieldWithPointerArticle: 504 typename = "Article" 505 506 result := struct { 507 TypeName string `json:"__typename"` 508 *InterfaceListOfListOfListsFieldWithPointerArticle 509 }{typename, v} 510 return json.Marshal(result) 511 case *InterfaceListOfListOfListsFieldWithPointerVideo: 512 typename = "Video" 513 514 result := struct { 515 TypeName string `json:"__typename"` 516 *InterfaceListOfListOfListsFieldWithPointerVideo 517 }{typename, v} 518 return json.Marshal(result) 519 case *InterfaceListOfListOfListsFieldWithPointerTopic: 520 typename = "Topic" 521 522 result := struct { 523 TypeName string `json:"__typename"` 524 *InterfaceListOfListOfListsFieldWithPointerTopic 525 }{typename, v} 526 return json.Marshal(result) 527 case nil: 528 return []byte("null"), nil 529 default: 530 return nil, fmt.Errorf( 531 `unexpected concrete type for InterfaceListOfListOfListsFieldWithPointerContent: "%T"`, v) 532 } 533 } 534 535 // InterfaceListOfListOfListsFieldWithPointerTopic includes the requested fields of the GraphQL type Topic. 536 type InterfaceListOfListOfListsFieldWithPointerTopic struct { 537 Typename string `json:"__typename"` 538 // ID is the identifier of the content. 539 Id *testutil.ID `json:"id"` 540 Name *string `json:"name"` 541 } 542 543 // GetTypename returns InterfaceListOfListOfListsFieldWithPointerTopic.Typename, and is useful for accessing the field via an interface. 544 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetTypename() string { return v.Typename } 545 546 // GetId returns InterfaceListOfListOfListsFieldWithPointerTopic.Id, and is useful for accessing the field via an interface. 547 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetId() *testutil.ID { return v.Id } 548 549 // GetName returns InterfaceListOfListOfListsFieldWithPointerTopic.Name, and is useful for accessing the field via an interface. 550 func (v *InterfaceListOfListOfListsFieldWithPointerTopic) GetName() *string { return v.Name } 551 552 // InterfaceListOfListOfListsFieldWithPointerVideo includes the requested fields of the GraphQL type Video. 553 type InterfaceListOfListOfListsFieldWithPointerVideo struct { 554 Typename string `json:"__typename"` 555 // ID is the identifier of the content. 556 Id *testutil.ID `json:"id"` 557 Name *string `json:"name"` 558 } 559 560 // GetTypename returns InterfaceListOfListOfListsFieldWithPointerVideo.Typename, and is useful for accessing the field via an interface. 561 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetTypename() string { return v.Typename } 562 563 // GetId returns InterfaceListOfListOfListsFieldWithPointerVideo.Id, and is useful for accessing the field via an interface. 564 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetId() *testutil.ID { return v.Id } 565 566 // GetName returns InterfaceListOfListOfListsFieldWithPointerVideo.Name, and is useful for accessing the field via an interface. 567 func (v *InterfaceListOfListOfListsFieldWithPointerVideo) GetName() *string { return v.Name } 568 569 func InterfaceListOfListOfListsField( 570 client graphql.Client, 571 ) (*InterfaceListOfListOfListsFieldResponse, error) { 572 req := &graphql.Request{ 573 OpName: "InterfaceListOfListOfListsField", 574 Query: ` 575 query InterfaceListOfListOfListsField { 576 listOfListsOfListsOfContent { 577 __typename 578 id 579 name 580 } 581 withPointer: listOfListsOfListsOfContent { 582 __typename 583 id 584 name 585 } 586 } 587 `, 588 } 589 var err error 590 591 var data InterfaceListOfListOfListsFieldResponse 592 resp := &graphql.Response{Data: &data} 593 594 err = client.MakeRequest( 595 nil, 596 req, 597 resp, 598 ) 599 600 return &data, err 601 } 602