Allow genqlient types to be marshaled safely (#120)
## Summary: When genqlient generates output types, it generates whatever code is necessary to unmarshal them. Conversely, when it generates input types, it generates whatever code is necessary to marshal. This is all that's needed for genqlient itself: it never needs to marshal output types or unmarshal input types. But maybe you do! (For example, to put the responses in a cache, which is the use case that @csilvers hit at Khan, although there are others one can imagine.) While we can't support every serialization format you might want (at least not without adding plugins or some such), it's not unreasonable to expect that since genqlient can read JSON, it can write it too. Sadly, in the past this was not true for types requiring custom unmarshaling logic, for several reasons. In this commit I implement logic to always write both marshalers and unmarshalers whenever they're needed to be able to correctly round-trip the types, even though genqlient doesn't do so. I wasn't starting from scratch, since of course we already write both marshalers and unmarshalers in some cases. But this ended up requiring surprisingly large changes on the marshaling side, mostly to correctly support embedding (which we use for named fragments). Specifically, as the comments in `types.go` discuss, the most difficult issue is spreads with duplicate fields, which translate to Go embedded fields which end up hidden from the json-marshaler. Ultimately, I had to do things quite differently from unmarshaling, and essentially flatten the type when we write marshaler. But in the end it's not so ugly -- indeed arguably it's cleaner! Mainly it's just different. One thing to note is that we do marshal `__typename` based on what we know about the types; users need not fill it in (and if they do we'll ignore it). This seemed to me to be a better UX, and didn't add much complexity. In general, I begin to wonder whether using `encoding/json` at all is really right for genqlient: we're doing a lot of work to appease it, despite knowing what our types look like. I think it would still be a significant increase in lines of code to roll our own, but that code would perhaps be simpler, and would surely be faster (although if we just want the speed gains we could use another JSON-generator library, see also #47). Anyway, something to think about in the future. ## Test plan: make tesc Author: benjaminjkraft Reviewers: csilvers, StevenACoffman, benjaminjkraft, dnerdy, aberkan, jvoll, mahtabsabet, MiguelCastillo Required Reviewers: Approved By: StevenACoffman, dnerdy Checks: ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint, ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint Pull Request URL: https://github.com/Khan/genqlient/pull/120
This commit is contained in:
+370
@@ -87,6 +87,42 @@ func __unmarshalComplexInlineFragmentsConflictingStuffContent(b []byte, v *Compl
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsConflictingStuffContent(v *ComplexInlineFragmentsConflictingStuffContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsConflictingStuffArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsConflictingStuffArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsConflictingStuffVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsConflictingStuffVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsConflictingStuffTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsConflictingStuffTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsConflictingStuffContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsConflictingStuffTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsConflictingStuffTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -174,6 +210,46 @@ func __unmarshalComplexInlineFragmentsNestedStuffContent(b []byte, v *ComplexInl
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsNestedStuffContent(v *ComplexInlineFragmentsNestedStuffContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsNestedStuffArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffTopic:
|
||||
typename = "Topic"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalComplexInlineFragmentsNestedStuffTopic
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsNestedStuffContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsNestedStuffTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsNestedStuffTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -219,6 +295,45 @@ func (v *ComplexInlineFragmentsNestedStuffTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalComplexInlineFragmentsNestedStuffTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsNestedStuffTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsNestedStuffTopic) __premarshalJSON() (*__premarshalComplexInlineFragmentsNestedStuffTopic, error) {
|
||||
var retval __premarshalComplexInlineFragmentsNestedStuffTopic
|
||||
|
||||
retval.Typename = v.Typename
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsNestedStuffTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsNestedStuffTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsNestedStuffTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type ComplexInlineFragmentsNestedStuffTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -272,6 +387,42 @@ func (v *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParen
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic struct {
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic) __premarshalJSON() (*__premarshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic, error) {
|
||||
var retval __premarshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -388,6 +539,42 @@ func __unmarshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentConte
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenContent(v *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsNestedStuffTopicChildrenArticleParentContentParentTopicChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -491,6 +678,42 @@ func __unmarshalComplexInlineFragmentsNestedStuffTopicChildrenContent(b []byte,
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsNestedStuffTopicChildrenContent(v *ComplexInlineFragmentsNestedStuffTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsNestedStuffTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsNestedStuffTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsNestedStuffTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsNestedStuffTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsNestedStuffTopicChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -609,6 +832,42 @@ func __unmarshalComplexInlineFragmentsRandomItemContent(b []byte, v *ComplexInli
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsRandomItemContent(v *ComplexInlineFragmentsRandomItemContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsRandomItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRandomItemArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsRandomItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRandomItemVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsRandomItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRandomItemTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsRandomItemContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsRandomItemTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -765,6 +1024,42 @@ func __unmarshalComplexInlineFragmentsRepeatedStuffContent(b []byte, v *ComplexI
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalComplexInlineFragmentsRepeatedStuffContent(v *ComplexInlineFragmentsRepeatedStuffContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ComplexInlineFragmentsRepeatedStuffArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRepeatedStuffArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsRepeatedStuffVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRepeatedStuffVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ComplexInlineFragmentsRepeatedStuffTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ComplexInlineFragmentsRepeatedStuffTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ComplexInlineFragmentsRepeatedStuffContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsRepeatedStuffTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsRepeatedStuffTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -874,6 +1169,81 @@ func (v *ComplexInlineFragmentsResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalComplexInlineFragmentsResponse struct {
|
||||
Root ComplexInlineFragmentsRootTopic `json:"root"`
|
||||
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RepeatedStuff json.RawMessage `json:"repeatedStuff"`
|
||||
|
||||
ConflictingStuff json.RawMessage `json:"conflictingStuff"`
|
||||
|
||||
NestedStuff json.RawMessage `json:"nestedStuff"`
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *ComplexInlineFragmentsResponse) __premarshalJSON() (*__premarshalComplexInlineFragmentsResponse, error) {
|
||||
var retval __premarshalComplexInlineFragmentsResponse
|
||||
|
||||
retval.Root = v.Root
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsResponse.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RepeatedStuff
|
||||
src := v.RepeatedStuff
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsRepeatedStuffContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsResponse.RepeatedStuff: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.ConflictingStuff
|
||||
src := v.ConflictingStuff
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsConflictingStuffContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsResponse.ConflictingStuff: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.NestedStuff
|
||||
src := v.NestedStuff
|
||||
var err error
|
||||
*dst, err = __marshalComplexInlineFragmentsNestedStuffContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexInlineFragmentsResponse.NestedStuff: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// ComplexInlineFragmentsRootTopic includes the requested fields of the GraphQL type Topic.
|
||||
type ComplexInlineFragmentsRootTopic struct {
|
||||
// ID is documented in the Content interface.
|
||||
|
||||
+685
@@ -40,6 +40,64 @@ func (v *ComplexNamedFragmentsResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalComplexNamedFragmentsResponse struct {
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RandomLeaf json.RawMessage `json:"randomLeaf"`
|
||||
|
||||
OtherLeaf json.RawMessage `json:"otherLeaf"`
|
||||
}
|
||||
|
||||
func (v *ComplexNamedFragmentsResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *ComplexNamedFragmentsResponse) __premarshalJSON() (*__premarshalComplexNamedFragmentsResponse, error) {
|
||||
var retval __premarshalComplexNamedFragmentsResponse
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.QueryFragment.InnerQueryFragment.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexNamedFragmentsResponse.QueryFragment.InnerQueryFragment.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RandomLeaf
|
||||
src := v.QueryFragment.InnerQueryFragment.RandomLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexNamedFragmentsResponse.QueryFragment.InnerQueryFragment.RandomLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.OtherLeaf
|
||||
src := v.QueryFragment.InnerQueryFragment.OtherLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentOtherLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal ComplexNamedFragmentsResponse.QueryFragment.InnerQueryFragment.OtherLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// ContentFields includes the GraphQL fields of Content requested by the fragment ContentFields.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
@@ -113,6 +171,42 @@ func __unmarshalContentFields(b []byte, v *ContentFields) error {
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalContentFields(v *ContentFields) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ContentFieldsArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ContentFieldsArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ContentFieldsVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ContentFieldsVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ContentFieldsTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ContentFieldsTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for ContentFields: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ContentFields includes the GraphQL fields of Article requested by the fragment ContentFields.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
@@ -211,6 +305,64 @@ func (v *InnerQueryFragment) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragment struct {
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RandomLeaf json.RawMessage `json:"randomLeaf"`
|
||||
|
||||
OtherLeaf json.RawMessage `json:"otherLeaf"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragment) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragment) __premarshalJSON() (*__premarshalInnerQueryFragment, error) {
|
||||
var retval __premarshalInnerQueryFragment
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InnerQueryFragment.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RandomLeaf
|
||||
src := v.RandomLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InnerQueryFragment.RandomLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.OtherLeaf
|
||||
src := v.OtherLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentOtherLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InnerQueryFragment.OtherLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentOtherLeafArticle includes the requested fields of the GraphQL type Article.
|
||||
type InnerQueryFragmentOtherLeafArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -242,6 +394,31 @@ func (v *InnerQueryFragmentOtherLeafArticle) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentOtherLeafArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentOtherLeafArticle) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentOtherLeafArticle) __premarshalJSON() (*__premarshalInnerQueryFragmentOtherLeafArticle, error) {
|
||||
var retval __premarshalInnerQueryFragmentOtherLeafArticle
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Name = v.ContentFieldsArticle.Name
|
||||
retval.Url = v.ContentFieldsArticle.Url
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentOtherLeafLeafContent includes the requested fields of the GraphQL interface LeafContent.
|
||||
//
|
||||
// InnerQueryFragmentOtherLeafLeafContent is implemented by the following types:
|
||||
@@ -297,6 +474,42 @@ func __unmarshalInnerQueryFragmentOtherLeafLeafContent(b []byte, v *InnerQueryFr
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInnerQueryFragmentOtherLeafLeafContent(v *InnerQueryFragmentOtherLeafLeafContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InnerQueryFragmentOtherLeafArticle:
|
||||
typename = "Article"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentOtherLeafArticle
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *InnerQueryFragmentOtherLeafVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentOtherLeafVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InnerQueryFragmentOtherLeafLeafContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InnerQueryFragmentOtherLeafVideo includes the requested fields of the GraphQL type Video.
|
||||
type InnerQueryFragmentOtherLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -334,6 +547,37 @@ func (v *InnerQueryFragmentOtherLeafVideo) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentOtherLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id *testutil.ID `json:"id"`
|
||||
|
||||
Parent *MoreVideoFieldsParentTopic `json:"parent"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentOtherLeafVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentOtherLeafVideo) __premarshalJSON() (*__premarshalInnerQueryFragmentOtherLeafVideo, error) {
|
||||
var retval __premarshalInnerQueryFragmentOtherLeafVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.MoreVideoFields.Id
|
||||
retval.Parent = v.MoreVideoFields.Parent
|
||||
retval.Name = v.ContentFieldsVideo.Name
|
||||
retval.Url = v.ContentFieldsVideo.Url
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomItemArticle includes the requested fields of the GraphQL type Article.
|
||||
type InnerQueryFragmentRandomItemArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -368,6 +612,34 @@ func (v *InnerQueryFragmentRandomItemArticle) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentRandomItemArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemArticle) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemArticle) __premarshalJSON() (*__premarshalInnerQueryFragmentRandomItemArticle, error) {
|
||||
var retval __premarshalInnerQueryFragmentRandomItemArticle
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.ContentFieldsArticle.Url
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomItemContent includes the requested fields of the GraphQL interface Content.
|
||||
//
|
||||
// InnerQueryFragmentRandomItemContent is implemented by the following types:
|
||||
@@ -459,6 +731,54 @@ func __unmarshalInnerQueryFragmentRandomItemContent(b []byte, v *InnerQueryFragm
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInnerQueryFragmentRandomItemContent(v *InnerQueryFragmentRandomItemContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InnerQueryFragmentRandomItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentRandomItemArticle
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *InnerQueryFragmentRandomItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentRandomItemVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *InnerQueryFragmentRandomItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentRandomItemTopic
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InnerQueryFragmentRandomItemContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomItemTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InnerQueryFragmentRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -493,6 +813,34 @@ func (v *InnerQueryFragmentRandomItemTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemTopic) __premarshalJSON() (*__premarshalInnerQueryFragmentRandomItemTopic, error) {
|
||||
var retval __premarshalInnerQueryFragmentRandomItemTopic
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.ContentFieldsTopic.Url
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomItemVideo includes the requested fields of the GraphQL type Video.
|
||||
type InnerQueryFragmentRandomItemVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -533,6 +881,40 @@ func (v *InnerQueryFragmentRandomItemVideo) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentRandomItemVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomItemVideo) __premarshalJSON() (*__premarshalInnerQueryFragmentRandomItemVideo, error) {
|
||||
var retval __premarshalInnerQueryFragmentRandomItemVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.VideoFields.Url
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
retval.Thumbnail = v.VideoFields.Thumbnail
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomLeafArticle includes the requested fields of the GraphQL type Article.
|
||||
type InnerQueryFragmentRandomLeafArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -564,6 +946,31 @@ func (v *InnerQueryFragmentRandomLeafArticle) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentRandomLeafArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomLeafArticle) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomLeafArticle) __premarshalJSON() (*__premarshalInnerQueryFragmentRandomLeafArticle, error) {
|
||||
var retval __premarshalInnerQueryFragmentRandomLeafArticle
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Name = v.ContentFieldsArticle.Name
|
||||
retval.Url = v.ContentFieldsArticle.Url
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomLeafLeafContent includes the requested fields of the GraphQL interface LeafContent.
|
||||
//
|
||||
// InnerQueryFragmentRandomLeafLeafContent is implemented by the following types:
|
||||
@@ -619,6 +1026,42 @@ func __unmarshalInnerQueryFragmentRandomLeafLeafContent(b []byte, v *InnerQueryF
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInnerQueryFragmentRandomLeafLeafContent(v *InnerQueryFragmentRandomLeafLeafContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InnerQueryFragmentRandomLeafArticle:
|
||||
typename = "Article"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentRandomLeafArticle
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *InnerQueryFragmentRandomLeafVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalInnerQueryFragmentRandomLeafVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InnerQueryFragmentRandomLeafLeafContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InnerQueryFragmentRandomLeafVideo includes the requested fields of the GraphQL type Video.
|
||||
type InnerQueryFragmentRandomLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -662,6 +1105,43 @@ func (v *InnerQueryFragmentRandomLeafVideo) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInnerQueryFragmentRandomLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
|
||||
Parent *MoreVideoFieldsParentTopic `json:"parent"`
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomLeafVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InnerQueryFragmentRandomLeafVideo) __premarshalJSON() (*__premarshalInnerQueryFragmentRandomLeafVideo, error) {
|
||||
var retval __premarshalInnerQueryFragmentRandomLeafVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.VideoFields.Id
|
||||
retval.Name = v.VideoFields.Name
|
||||
retval.Url = v.VideoFields.Url
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
retval.Thumbnail = v.VideoFields.Thumbnail
|
||||
retval.Parent = v.MoreVideoFields.Parent
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// MoreVideoFields includes the GraphQL fields of Video requested by the fragment MoreVideoFields.
|
||||
type MoreVideoFields struct {
|
||||
// ID is documented in the Content interface.
|
||||
@@ -722,6 +1202,48 @@ func (v *MoreVideoFieldsParentTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalMoreVideoFieldsParentTopic struct {
|
||||
Name *string `json:"name"`
|
||||
|
||||
Url *string `json:"url"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *MoreVideoFieldsParentTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *MoreVideoFieldsParentTopic) __premarshalJSON() (*__premarshalMoreVideoFieldsParentTopic, error) {
|
||||
var retval __premarshalMoreVideoFieldsParentTopic
|
||||
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.Url
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalMoreVideoFieldsParentTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal MoreVideoFieldsParentTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// MoreVideoFieldsParentTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type MoreVideoFieldsParentTopicChildrenArticle struct {
|
||||
Typename *string `json:"__typename"`
|
||||
@@ -792,6 +1314,46 @@ func __unmarshalMoreVideoFieldsParentTopicChildrenContent(b []byte, v *MoreVideo
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalMoreVideoFieldsParentTopicChildrenContent(v *MoreVideoFieldsParentTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *MoreVideoFieldsParentTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*MoreVideoFieldsParentTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *MoreVideoFieldsParentTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalMoreVideoFieldsParentTopicChildrenVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *MoreVideoFieldsParentTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*MoreVideoFieldsParentTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for MoreVideoFieldsParentTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// MoreVideoFieldsParentTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type MoreVideoFieldsParentTopicChildrenTopic struct {
|
||||
Typename *string `json:"__typename"`
|
||||
@@ -828,6 +1390,40 @@ func (v *MoreVideoFieldsParentTopicChildrenVideo) UnmarshalJSON(b []byte) error
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalMoreVideoFieldsParentTopicChildrenVideo struct {
|
||||
Typename *string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
}
|
||||
|
||||
func (v *MoreVideoFieldsParentTopicChildrenVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *MoreVideoFieldsParentTopicChildrenVideo) __premarshalJSON() (*__premarshalMoreVideoFieldsParentTopicChildrenVideo, error) {
|
||||
var retval __premarshalMoreVideoFieldsParentTopicChildrenVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.VideoFields.Id
|
||||
retval.Name = v.VideoFields.Name
|
||||
retval.Url = v.VideoFields.Url
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
retval.Thumbnail = v.VideoFields.Thumbnail
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// QueryFragment includes the GraphQL fields of Query requested by the fragment QueryFragment.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
@@ -861,6 +1457,64 @@ func (v *QueryFragment) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalQueryFragment struct {
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RandomLeaf json.RawMessage `json:"randomLeaf"`
|
||||
|
||||
OtherLeaf json.RawMessage `json:"otherLeaf"`
|
||||
}
|
||||
|
||||
func (v *QueryFragment) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *QueryFragment) __premarshalJSON() (*__premarshalQueryFragment, error) {
|
||||
var retval __premarshalQueryFragment
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.InnerQueryFragment.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal QueryFragment.InnerQueryFragment.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RandomLeaf
|
||||
src := v.InnerQueryFragment.RandomLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentRandomLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal QueryFragment.InnerQueryFragment.RandomLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.OtherLeaf
|
||||
src := v.InnerQueryFragment.OtherLeaf
|
||||
var err error
|
||||
*dst, err = __marshalInnerQueryFragmentOtherLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal QueryFragment.InnerQueryFragment.OtherLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// VideoFields includes the GraphQL fields of Video requested by the fragment VideoFields.
|
||||
type VideoFields struct {
|
||||
// ID is documented in the Content interface.
|
||||
@@ -897,6 +1551,37 @@ func (v *VideoFields) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalVideoFields struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
}
|
||||
|
||||
func (v *VideoFields) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *VideoFields) __premarshalJSON() (*__premarshalVideoFields, error) {
|
||||
var retval __premarshalVideoFields
|
||||
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.Url
|
||||
retval.Duration = v.Duration
|
||||
retval.Thumbnail = v.Thumbnail
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// VideoFieldsThumbnail includes the requested fields of the GraphQL type Thumbnail.
|
||||
type VideoFieldsThumbnail struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
+78
-7
@@ -61,23 +61,95 @@ func (v *CustomMarshalUsersBornOnUser) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalCustomMarshalUsersBornOnUser struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *CustomMarshalUsersBornOnUser) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *CustomMarshalUsersBornOnUser) __premarshalJSON() (*__premarshalCustomMarshalUsersBornOnUser, error) {
|
||||
var retval __premarshalCustomMarshalUsersBornOnUser
|
||||
|
||||
retval.Id = v.Id
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal CustomMarshalUsersBornOnUser.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __CustomMarshalInput is used internally by genqlient
|
||||
type __CustomMarshalInput struct {
|
||||
Date time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *__CustomMarshalInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*__CustomMarshalInput
|
||||
Date json.RawMessage `json:"date"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
fullObject.__CustomMarshalInput = v
|
||||
firstPass.__CustomMarshalInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
{
|
||||
dst := &v.Date
|
||||
src := firstPass.Date
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal __CustomMarshalInput.Date: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshal__CustomMarshalInput struct {
|
||||
Date json.RawMessage `json:"date"`
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalInput) __premarshalJSON() (*__premarshal__CustomMarshalInput, error) {
|
||||
var retval __premarshal__CustomMarshalInput
|
||||
|
||||
{
|
||||
|
||||
dst := &fullObject.Date
|
||||
dst := &retval.Date
|
||||
src := v.Date
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
@@ -87,8 +159,7 @@ func (v *__CustomMarshalInput) MarshalJSON() ([]byte, error) {
|
||||
"Unable to marshal __CustomMarshalInput.Date: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
func CustomMarshal(
|
||||
|
||||
Vendored
+98
-8
@@ -23,19 +23,110 @@ type __CustomMarshalSliceInput struct {
|
||||
Datesssp [][][]*time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalSliceInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *__CustomMarshalSliceInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*__CustomMarshalSliceInput
|
||||
Datesss [][][]json.RawMessage `json:"datesss"`
|
||||
Datesssp [][][]json.RawMessage `json:"datesssp"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
fullObject.__CustomMarshalSliceInput = v
|
||||
firstPass.__CustomMarshalSliceInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
{
|
||||
dst := &v.Datesss
|
||||
src := firstPass.Datesss
|
||||
*dst = make(
|
||||
[][][]time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[][]time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[]time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal __CustomMarshalSliceInput.Datesss: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
dst := &v.Datesssp
|
||||
src := firstPass.Datesssp
|
||||
*dst = make(
|
||||
[][][]*time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[][]*time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[]*time.Time,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
*dst = new(time.Time)
|
||||
err = testutil.UnmarshalDate(
|
||||
src, *dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal __CustomMarshalSliceInput.Datesssp: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshal__CustomMarshalSliceInput struct {
|
||||
Datesss [][][]json.RawMessage `json:"datesss"`
|
||||
|
||||
Datesssp [][][]json.RawMessage `json:"datesssp"`
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalSliceInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *__CustomMarshalSliceInput) __premarshalJSON() (*__premarshal__CustomMarshalSliceInput, error) {
|
||||
var retval __premarshal__CustomMarshalSliceInput
|
||||
|
||||
{
|
||||
|
||||
dst := &fullObject.Datesss
|
||||
dst := &retval.Datesss
|
||||
src := v.Datesss
|
||||
*dst = make(
|
||||
[][][]json.RawMessage,
|
||||
@@ -65,7 +156,7 @@ func (v *__CustomMarshalSliceInput) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
{
|
||||
|
||||
dst := &fullObject.Datesssp
|
||||
dst := &retval.Datesssp
|
||||
src := v.Datesssp
|
||||
*dst = make(
|
||||
[][][]json.RawMessage,
|
||||
@@ -95,8 +186,7 @@ func (v *__CustomMarshalSliceInput) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
func CustomMarshalSlice(
|
||||
|
||||
+63
-7
@@ -61,18 +61,75 @@ type UserQueryInput struct {
|
||||
Birthdate time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email string `json:"email"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Role Role `json:"role"`
|
||||
|
||||
Names []string `json:"names"`
|
||||
|
||||
HasPokemon testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
@@ -82,8 +139,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
"Unable to marshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __InputObjectQueryInput is used internally by genqlient
|
||||
|
||||
Vendored
+156
@@ -63,6 +63,48 @@ func (v *InterfaceListFieldRootTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceListFieldRootTopic struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *InterfaceListFieldRootTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceListFieldRootTopic) __premarshalJSON() (*__premarshalInterfaceListFieldRootTopic, error) {
|
||||
var retval __premarshalInterfaceListFieldRootTopic
|
||||
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceListFieldRootTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceListFieldRootTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceListFieldRootTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceListFieldRootTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -161,6 +203,42 @@ func __unmarshalInterfaceListFieldRootTopicChildrenContent(b []byte, v *Interfac
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceListFieldRootTopicChildrenContent(v *InterfaceListFieldRootTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceListFieldRootTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldRootTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListFieldRootTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldRootTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListFieldRootTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldRootTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceListFieldRootTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceListFieldRootTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceListFieldRootTopicChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -224,6 +302,48 @@ func (v *InterfaceListFieldWithPointerTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceListFieldWithPointerTopic struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *InterfaceListFieldWithPointerTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceListFieldWithPointerTopic) __premarshalJSON() (*__premarshalInterfaceListFieldWithPointerTopic, error) {
|
||||
var retval __premarshalInterfaceListFieldWithPointerTopic
|
||||
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceListFieldWithPointerTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceListFieldWithPointerTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceListFieldWithPointerTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceListFieldWithPointerTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -322,6 +442,42 @@ func __unmarshalInterfaceListFieldWithPointerTopicChildrenContent(b []byte, v *I
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceListFieldWithPointerTopicChildrenContent(v *InterfaceListFieldWithPointerTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceListFieldWithPointerTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldWithPointerTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListFieldWithPointerTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldWithPointerTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListFieldWithPointerTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListFieldWithPointerTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceListFieldWithPointerTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceListFieldWithPointerTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceListFieldWithPointerTopicChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
+154
@@ -118,6 +118,42 @@ func __unmarshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent(b []b
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent(v *InterfaceListOfListOfListsFieldListOfListsOfListsOfContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldListOfListsOfListsOfContentTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceListOfListOfListsFieldListOfListsOfListsOfContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceListOfListOfListsFieldListOfListsOfListsOfContentArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -232,6 +268,88 @@ func (v *InterfaceListOfListOfListsFieldResponse) UnmarshalJSON(b []byte) error
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceListOfListOfListsFieldResponse struct {
|
||||
ListOfListsOfListsOfContent [][][]json.RawMessage `json:"listOfListsOfListsOfContent"`
|
||||
|
||||
WithPointer [][][]json.RawMessage `json:"withPointer"`
|
||||
}
|
||||
|
||||
func (v *InterfaceListOfListOfListsFieldResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceListOfListOfListsFieldResponse) __premarshalJSON() (*__premarshalInterfaceListOfListOfListsFieldResponse, error) {
|
||||
var retval __premarshalInterfaceListOfListOfListsFieldResponse
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.ListOfListsOfListsOfContent
|
||||
src := v.ListOfListsOfListsOfContent
|
||||
*dst = make(
|
||||
[][][]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[][]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceListOfListOfListsFieldListOfListsOfListsOfContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceListOfListOfListsFieldResponse.ListOfListsOfListsOfContent: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.WithPointer
|
||||
src := v.WithPointer
|
||||
*dst = make(
|
||||
[][][]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[][]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
if src != nil {
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceListOfListOfListsFieldWithPointerContent(
|
||||
src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceListOfListOfListsFieldResponse.WithPointer: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceListOfListOfListsFieldWithPointerArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceListOfListOfListsFieldWithPointerArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -330,6 +448,42 @@ func __unmarshalInterfaceListOfListOfListsFieldWithPointerContent(b []byte, v *I
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceListOfListOfListsFieldWithPointerContent(v *InterfaceListOfListOfListsFieldWithPointerContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceListOfListOfListsFieldWithPointerArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldWithPointerArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListOfListOfListsFieldWithPointerVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldWithPointerVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceListOfListOfListsFieldWithPointerTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceListOfListOfListsFieldWithPointerTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceListOfListOfListsFieldWithPointerContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceListOfListOfListsFieldWithPointerTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceListOfListOfListsFieldWithPointerTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Vendored
+150
@@ -61,6 +61,45 @@ func (v *InterfaceNestingRootTopic) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceNestingRootTopic struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *InterfaceNestingRootTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceNestingRootTopic) __premarshalJSON() (*__premarshalInterfaceNestingRootTopic, error) {
|
||||
var retval __premarshalInterfaceNestingRootTopic
|
||||
|
||||
retval.Id = v.Id
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceNestingRootTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceNestingRootTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceNestingRootTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceNestingRootTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -165,6 +204,42 @@ func __unmarshalInterfaceNestingRootTopicChildrenContent(b []byte, v *InterfaceN
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceNestingRootTopicChildrenContent(v *InterfaceNestingRootTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceNestingRootTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNestingRootTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNestingRootTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceNestingRootTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceNestingRootTopicChildrenContentParentTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNestingRootTopicChildrenContentParentTopic struct {
|
||||
// ID is documented in the Content interface.
|
||||
@@ -211,6 +286,45 @@ func (v *InterfaceNestingRootTopicChildrenContentParentTopic) UnmarshalJSON(b []
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceNestingRootTopicChildrenContentParentTopic struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Children []json.RawMessage `json:"children"`
|
||||
}
|
||||
|
||||
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) __premarshalJSON() (*__premarshalInterfaceNestingRootTopicChildrenContentParentTopic, error) {
|
||||
var retval __premarshalInterfaceNestingRootTopicChildrenContentParentTopic
|
||||
|
||||
retval.Id = v.Id
|
||||
{
|
||||
|
||||
dst := &retval.Children
|
||||
src := v.Children
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceNestingRootTopicChildrenContentParentTopic.Children: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle includes the requested fields of the GraphQL type Article.
|
||||
type InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -309,6 +423,42 @@ func __unmarshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenConte
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
+171
@@ -108,6 +108,42 @@ func __unmarshalInterfaceNoFragmentsQueryRandomItemContent(b []byte, v *Interfac
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceNoFragmentsQueryRandomItemContent(v *InterfaceNoFragmentsQueryRandomItemContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceNoFragmentsQueryRandomItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryRandomItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryRandomItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceNoFragmentsQueryRandomItemContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceNoFragmentsQueryRandomItemTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNoFragmentsQueryRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -228,6 +264,42 @@ func __unmarshalInterfaceNoFragmentsQueryRandomItemWithTypeNameContent(b []byte,
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceNoFragmentsQueryRandomItemWithTypeNameContent(v *InterfaceNoFragmentsQueryRandomItemWithTypeNameContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceNoFragmentsQueryRandomItemWithTypeNameArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemWithTypeNameArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryRandomItemWithTypeNameVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemWithTypeNameVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryRandomItemWithTypeNameTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryRandomItemWithTypeNameTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceNoFragmentsQueryRandomItemWithTypeNameContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceNoFragmentsQueryRandomItemWithTypeNameTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNoFragmentsQueryRandomItemWithTypeNameTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -314,6 +386,69 @@ func (v *InterfaceNoFragmentsQueryResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalInterfaceNoFragmentsQueryResponse struct {
|
||||
Root InterfaceNoFragmentsQueryRootTopic `json:"root"`
|
||||
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RandomItemWithTypeName json.RawMessage `json:"randomItemWithTypeName"`
|
||||
|
||||
WithPointer json.RawMessage `json:"withPointer"`
|
||||
}
|
||||
|
||||
func (v *InterfaceNoFragmentsQueryResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *InterfaceNoFragmentsQueryResponse) __premarshalJSON() (*__premarshalInterfaceNoFragmentsQueryResponse, error) {
|
||||
var retval __premarshalInterfaceNoFragmentsQueryResponse
|
||||
|
||||
retval.Root = v.Root
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceNoFragmentsQueryRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceNoFragmentsQueryResponse.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RandomItemWithTypeName
|
||||
src := v.RandomItemWithTypeName
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceNoFragmentsQueryRandomItemWithTypeNameContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceNoFragmentsQueryResponse.RandomItemWithTypeName: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.WithPointer
|
||||
src := v.WithPointer
|
||||
if src != nil {
|
||||
var err error
|
||||
*dst, err = __marshalInterfaceNoFragmentsQueryWithPointerContent(
|
||||
src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal InterfaceNoFragmentsQueryResponse.WithPointer: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// InterfaceNoFragmentsQueryRootTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNoFragmentsQueryRootTopic struct {
|
||||
// ID is documented in the Content interface.
|
||||
@@ -419,6 +554,42 @@ func __unmarshalInterfaceNoFragmentsQueryWithPointerContent(b []byte, v *Interfa
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalInterfaceNoFragmentsQueryWithPointerContent(v *InterfaceNoFragmentsQueryWithPointerContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *InterfaceNoFragmentsQueryWithPointerArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryWithPointerArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryWithPointerVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryWithPointerVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *InterfaceNoFragmentsQueryWithPointerTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*InterfaceNoFragmentsQueryWithPointerTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for InterfaceNoFragmentsQueryWithPointerContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceNoFragmentsQueryWithPointerTopic includes the requested fields of the GraphQL type Topic.
|
||||
type InterfaceNoFragmentsQueryWithPointerTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Vendored
+128
-14
@@ -27,18 +27,76 @@ type MyInput struct {
|
||||
Birthdate *time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *MyInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *MyInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*MyInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.MyInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.MyInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
*dst = new(time.Time)
|
||||
err = testutil.UnmarshalDate(
|
||||
src, *dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal MyInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalMyInput struct {
|
||||
Email *string `json:"email"`
|
||||
|
||||
Name *string `json:"name"`
|
||||
|
||||
Id *testutil.ID `json:"id"`
|
||||
|
||||
Role *Role `json:"role"`
|
||||
|
||||
Names []*string `json:"names"`
|
||||
|
||||
HasPokemon *testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *MyInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *MyInput) __premarshalJSON() (*__premarshalMyInput, error) {
|
||||
var retval __premarshalMyInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
if src != nil {
|
||||
var err error
|
||||
@@ -50,8 +108,7 @@ func (v *MyInput) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// MyMultipleDirectivesResponse is returned by MultipleDirectives on success.
|
||||
@@ -116,18 +173,76 @@ type UserQueryInput struct {
|
||||
Birthdate *time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
*dst = new(time.Time)
|
||||
err = testutil.UnmarshalDate(
|
||||
src, *dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email *string `json:"email"`
|
||||
|
||||
Name *string `json:"name"`
|
||||
|
||||
Id *testutil.ID `json:"id"`
|
||||
|
||||
Role *Role `json:"role"`
|
||||
|
||||
Names []*string `json:"names"`
|
||||
|
||||
HasPokemon *testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
if src != nil {
|
||||
var err error
|
||||
@@ -139,8 +254,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __MultipleDirectivesInput is used internally by genqlient
|
||||
|
||||
+63
-7
@@ -75,18 +75,75 @@ type UserQueryInput struct {
|
||||
Birthdate time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email string `json:"email"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Role Role `json:"role"`
|
||||
|
||||
Names []string `json:"names"`
|
||||
|
||||
HasPokemon testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
@@ -96,8 +153,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
"Unable to marshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __OmitEmptyQueryInput is used internally by genqlient
|
||||
|
||||
+64
-7
@@ -82,18 +82,76 @@ type UserQueryInput struct {
|
||||
Birthdate *time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
*dst = new(time.Time)
|
||||
err = testutil.UnmarshalDate(
|
||||
src, *dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email *string `json:"email"`
|
||||
|
||||
Name *string `json:"name"`
|
||||
|
||||
Id *testutil.ID `json:"id"`
|
||||
|
||||
Role *Role `json:"role"`
|
||||
|
||||
Names []*string `json:"names"`
|
||||
|
||||
HasPokemon *testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
if src != nil {
|
||||
var err error
|
||||
@@ -105,8 +163,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __PointersQueryInput is used internally by genqlient
|
||||
|
||||
+63
-7
@@ -82,18 +82,75 @@ type UserQueryInput struct {
|
||||
Birthdate time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email string `json:"email"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Role Role `json:"role"`
|
||||
|
||||
Names []string `json:"names"`
|
||||
|
||||
HasPokemon testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
@@ -103,8 +160,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
"Unable to marshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __PointersQueryInput is used internally by genqlient
|
||||
|
||||
+66
@@ -109,6 +109,42 @@ func __unmarshalSimpleInlineFragmentRandomItemContent(b []byte, v *SimpleInlineF
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalSimpleInlineFragmentRandomItemContent(v *SimpleInlineFragmentRandomItemContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *SimpleInlineFragmentRandomItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleInlineFragmentRandomItemArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *SimpleInlineFragmentRandomItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleInlineFragmentRandomItemVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *SimpleInlineFragmentRandomItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleInlineFragmentRandomItemTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for SimpleInlineFragmentRandomItemContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// SimpleInlineFragmentRandomItemTopic includes the requested fields of the GraphQL type Topic.
|
||||
type SimpleInlineFragmentRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -164,6 +200,36 @@ func (v *SimpleInlineFragmentResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalSimpleInlineFragmentResponse struct {
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
}
|
||||
|
||||
func (v *SimpleInlineFragmentResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *SimpleInlineFragmentResponse) __premarshalJSON() (*__premarshalSimpleInlineFragmentResponse, error) {
|
||||
var retval __premarshalSimpleInlineFragmentResponse
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalSimpleInlineFragmentRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal SimpleInlineFragmentResponse.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
func SimpleInlineFragment(
|
||||
client graphql.Client,
|
||||
) (*SimpleInlineFragmentResponse, error) {
|
||||
|
||||
Vendored
+184
@@ -108,6 +108,46 @@ func __unmarshalSimpleNamedFragmentRandomItemContent(b []byte, v *SimpleNamedFra
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalSimpleNamedFragmentRandomItemContent(v *SimpleNamedFragmentRandomItemContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *SimpleNamedFragmentRandomItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleNamedFragmentRandomItemArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *SimpleNamedFragmentRandomItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalSimpleNamedFragmentRandomItemVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *SimpleNamedFragmentRandomItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleNamedFragmentRandomItemTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for SimpleNamedFragmentRandomItemContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// SimpleNamedFragmentRandomItemTopic includes the requested fields of the GraphQL type Topic.
|
||||
type SimpleNamedFragmentRandomItemTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -150,6 +190,40 @@ func (v *SimpleNamedFragmentRandomItemVideo) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalSimpleNamedFragmentRandomItemVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentRandomItemVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentRandomItemVideo) __premarshalJSON() (*__premarshalSimpleNamedFragmentRandomItemVideo, error) {
|
||||
var retval __premarshalSimpleNamedFragmentRandomItemVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.Id
|
||||
retval.Name = v.Name
|
||||
retval.Url = v.VideoFields.Url
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
retval.Thumbnail = v.VideoFields.Thumbnail
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// SimpleNamedFragmentRandomLeafArticle includes the requested fields of the GraphQL type Article.
|
||||
type SimpleNamedFragmentRandomLeafArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -210,6 +284,38 @@ func __unmarshalSimpleNamedFragmentRandomLeafLeafContent(b []byte, v *SimpleName
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalSimpleNamedFragmentRandomLeafLeafContent(v *SimpleNamedFragmentRandomLeafLeafContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *SimpleNamedFragmentRandomLeafArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*SimpleNamedFragmentRandomLeafArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *SimpleNamedFragmentRandomLeafVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalSimpleNamedFragmentRandomLeafVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for SimpleNamedFragmentRandomLeafLeafContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// SimpleNamedFragmentRandomLeafVideo includes the requested fields of the GraphQL type Video.
|
||||
type SimpleNamedFragmentRandomLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -241,6 +347,40 @@ func (v *SimpleNamedFragmentRandomLeafVideo) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalSimpleNamedFragmentRandomLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Url string `json:"url"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail VideoFieldsThumbnail `json:"thumbnail"`
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentRandomLeafVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentRandomLeafVideo) __premarshalJSON() (*__premarshalSimpleNamedFragmentRandomLeafVideo, error) {
|
||||
var retval __premarshalSimpleNamedFragmentRandomLeafVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.VideoFields.Id
|
||||
retval.Name = v.VideoFields.Name
|
||||
retval.Url = v.VideoFields.Url
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
retval.Thumbnail = v.VideoFields.Thumbnail
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// SimpleNamedFragmentResponse is returned by SimpleNamedFragment on success.
|
||||
type SimpleNamedFragmentResponse struct {
|
||||
RandomItem SimpleNamedFragmentRandomItemContent `json:"-"`
|
||||
@@ -294,6 +434,50 @@ func (v *SimpleNamedFragmentResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalSimpleNamedFragmentResponse struct {
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
RandomLeaf json.RawMessage `json:"randomLeaf"`
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *SimpleNamedFragmentResponse) __premarshalJSON() (*__premarshalSimpleNamedFragmentResponse, error) {
|
||||
var retval __premarshalSimpleNamedFragmentResponse
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalSimpleNamedFragmentRandomItemContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal SimpleNamedFragmentResponse.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
dst := &retval.RandomLeaf
|
||||
src := v.RandomLeaf
|
||||
var err error
|
||||
*dst, err = __marshalSimpleNamedFragmentRandomLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal SimpleNamedFragmentResponse.RandomLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// VideoFields includes the GraphQL fields of Video requested by the fragment VideoFields.
|
||||
type VideoFields struct {
|
||||
// ID is documented in the Content interface.
|
||||
|
||||
+107
@@ -99,6 +99,48 @@ func (v *StructOptionRootTopicChildrenContentParentTopic) UnmarshalJSON(b []byte
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalStructOptionRootTopicChildrenContentParentTopic struct {
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Children []StructOptionRootTopicChildrenContentParentTopicChildrenContent `json:"children"`
|
||||
|
||||
InterfaceChildren []json.RawMessage `json:"interfaceChildren"`
|
||||
}
|
||||
|
||||
func (v *StructOptionRootTopicChildrenContentParentTopic) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *StructOptionRootTopicChildrenContentParentTopic) __premarshalJSON() (*__premarshalStructOptionRootTopicChildrenContentParentTopic, error) {
|
||||
var retval __premarshalStructOptionRootTopicChildrenContentParentTopic
|
||||
|
||||
retval.Id = v.Id
|
||||
retval.Children = v.Children
|
||||
{
|
||||
|
||||
dst := &retval.InterfaceChildren
|
||||
src := v.InterfaceChildren
|
||||
*dst = make(
|
||||
[]json.RawMessage,
|
||||
len(src))
|
||||
for i, src := range src {
|
||||
dst := &(*dst)[i]
|
||||
var err error
|
||||
*dst, err = __marshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal StructOptionRootTopicChildrenContentParentTopic.InterfaceChildren: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// StructOptionRootTopicChildrenContentParentTopicChildrenContent includes the requested fields of the GraphQL type Content.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
@@ -207,6 +249,46 @@ func __unmarshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildren
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenContent(v *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo:
|
||||
typename = "Video"
|
||||
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*__premarshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo
|
||||
}{typename, premarshaled}
|
||||
return json.Marshal(result)
|
||||
case *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenTopic includes the requested fields of the GraphQL type Topic.
|
||||
type StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenTopic struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -247,6 +329,31 @@ func (v *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo)
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Duration int `json:"duration"`
|
||||
}
|
||||
|
||||
func (v *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *StructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo) __premarshalJSON() (*__premarshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo, error) {
|
||||
var retval __premarshalStructOptionRootTopicChildrenContentParentTopicInterfaceChildrenVideo
|
||||
|
||||
retval.Typename = v.Typename
|
||||
retval.Id = v.Id
|
||||
retval.Duration = v.VideoFields.Duration
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// StructOptionUser includes the requested fields of the GraphQL type User.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
|
||||
+72
@@ -97,6 +97,42 @@ func __unmarshalItem(b []byte, v *Item) error {
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalItem(v *Item) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *ItemArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ItemArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ItemVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ItemVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *ItemTopic:
|
||||
typename = "Topic"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*ItemTopic
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for Item: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// ItemArticle includes the requested fields of the GraphQL type Article.
|
||||
type ItemArticle struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -165,6 +201,42 @@ func (v *Resp) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalResp struct {
|
||||
User User `json:"user"`
|
||||
|
||||
RandomItem json.RawMessage `json:"randomItem"`
|
||||
|
||||
Users []User `json:"users"`
|
||||
}
|
||||
|
||||
func (v *Resp) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *Resp) __premarshalJSON() (*__premarshalResp, error) {
|
||||
var retval __premarshalResp
|
||||
|
||||
retval.User = v.User
|
||||
{
|
||||
|
||||
dst := &retval.RandomItem
|
||||
src := v.RandomItem
|
||||
var err error
|
||||
*dst, err = __marshalItem(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal Resp.RandomItem: %w", err)
|
||||
}
|
||||
}
|
||||
retval.Users = v.Users
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// User includes the requested fields of the GraphQL type User.
|
||||
// The GraphQL type's documentation follows.
|
||||
//
|
||||
|
||||
Vendored
+58
@@ -69,6 +69,34 @@ func __unmarshalUnionNoFragmentsQueryRandomLeafLeafContent(b []byte, v *UnionNoF
|
||||
}
|
||||
}
|
||||
|
||||
func __marshalUnionNoFragmentsQueryRandomLeafLeafContent(v *UnionNoFragmentsQueryRandomLeafLeafContent) ([]byte, error) {
|
||||
|
||||
var typename string
|
||||
switch v := (*v).(type) {
|
||||
case *UnionNoFragmentsQueryRandomLeafArticle:
|
||||
typename = "Article"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*UnionNoFragmentsQueryRandomLeafArticle
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case *UnionNoFragmentsQueryRandomLeafVideo:
|
||||
typename = "Video"
|
||||
|
||||
result := struct {
|
||||
TypeName string `json:"__typename"`
|
||||
*UnionNoFragmentsQueryRandomLeafVideo
|
||||
}{typename, v}
|
||||
return json.Marshal(result)
|
||||
case nil:
|
||||
return []byte("null"), nil
|
||||
default:
|
||||
return nil, fmt.Errorf(
|
||||
`Unexpected concrete type for UnionNoFragmentsQueryRandomLeafLeafContent: "%T"`, v)
|
||||
}
|
||||
}
|
||||
|
||||
// UnionNoFragmentsQueryRandomLeafVideo includes the requested fields of the GraphQL type Video.
|
||||
type UnionNoFragmentsQueryRandomLeafVideo struct {
|
||||
Typename string `json:"__typename"`
|
||||
@@ -112,6 +140,36 @@ func (v *UnionNoFragmentsQueryResponse) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type __premarshalUnionNoFragmentsQueryResponse struct {
|
||||
RandomLeaf json.RawMessage `json:"randomLeaf"`
|
||||
}
|
||||
|
||||
func (v *UnionNoFragmentsQueryResponse) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UnionNoFragmentsQueryResponse) __premarshalJSON() (*__premarshalUnionNoFragmentsQueryResponse, error) {
|
||||
var retval __premarshalUnionNoFragmentsQueryResponse
|
||||
|
||||
{
|
||||
|
||||
dst := &retval.RandomLeaf
|
||||
src := v.RandomLeaf
|
||||
var err error
|
||||
*dst, err = __marshalUnionNoFragmentsQueryRandomLeafLeafContent(
|
||||
&src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to marshal UnionNoFragmentsQueryResponse.RandomLeaf: %w", err)
|
||||
}
|
||||
}
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
func UnionNoFragmentsQuery(
|
||||
client graphql.Client,
|
||||
) (*UnionNoFragmentsQueryResponse, error) {
|
||||
|
||||
+63
-7
@@ -41,18 +41,75 @@ type UserQueryInput struct {
|
||||
Birthdate time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
func (v *UserQueryInput) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var fullObject struct {
|
||||
if string(b) == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var firstPass struct {
|
||||
*UserQueryInput
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
graphql.NoMarshalJSON
|
||||
graphql.NoUnmarshalJSON
|
||||
}
|
||||
firstPass.UserQueryInput = v
|
||||
|
||||
err := json.Unmarshal(b, &firstPass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fullObject.UserQueryInput = v
|
||||
|
||||
{
|
||||
dst := &v.Birthdate
|
||||
src := firstPass.Birthdate
|
||||
if len(src) != 0 && string(src) != "null" {
|
||||
err = testutil.UnmarshalDate(
|
||||
src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"Unable to unmarshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := &fullObject.Birthdate
|
||||
type __premarshalUserQueryInput struct {
|
||||
Email string `json:"email"`
|
||||
|
||||
Name string `json:"name"`
|
||||
|
||||
Id testutil.ID `json:"id"`
|
||||
|
||||
Role Role `json:"role"`
|
||||
|
||||
Names []string `json:"names"`
|
||||
|
||||
HasPokemon testutil.Pokemon `json:"hasPokemon"`
|
||||
|
||||
Birthdate json.RawMessage `json:"birthdate"`
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
premarshaled, err := v.__premarshalJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(premarshaled)
|
||||
}
|
||||
|
||||
func (v *UserQueryInput) __premarshalJSON() (*__premarshalUserQueryInput, error) {
|
||||
var retval __premarshalUserQueryInput
|
||||
|
||||
retval.Email = v.Email
|
||||
retval.Name = v.Name
|
||||
retval.Id = v.Id
|
||||
retval.Role = v.Role
|
||||
retval.Names = v.Names
|
||||
retval.HasPokemon = v.HasPokemon
|
||||
{
|
||||
|
||||
dst := &retval.Birthdate
|
||||
src := v.Birthdate
|
||||
var err error
|
||||
*dst, err = testutil.MarshalDate(
|
||||
@@ -62,8 +119,7 @@ func (v *UserQueryInput) MarshalJSON() ([]byte, error) {
|
||||
"Unable to marshal UserQueryInput.Birthdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return json.Marshal(&fullObject)
|
||||
return &retval, nil
|
||||
}
|
||||
|
||||
// __unexportedInput is used internally by genqlient
|
||||
|
||||
Reference in New Issue
Block a user