package test // Code generated by github.com/Khan/genqlient, DO NOT EDIT. import ( "encoding/json" "fmt" "time" "github.com/Khan/genqlient/graphql" "github.com/Khan/genqlient/internal/testutil" ) // CustomMarshalSliceResponse is returned by CustomMarshalSlice on success. type CustomMarshalSliceResponse struct { AcceptsListOfListOfListsOfDates bool `json:"acceptsListOfListOfListsOfDates"` WithPointer bool `json:"withPointer"` } // __CustomMarshalSliceInput is used internally by genqlient type __CustomMarshalSliceInput struct { Datesss [][][]time.Time `json:"-"` Datesssp [][][]*time.Time `json:"-"` } func (v *__CustomMarshalSliceInput) MarshalJSON() ([]byte, error) { var fullObject struct { *__CustomMarshalSliceInput Datesss [][][]json.RawMessage `json:"datesss"` Datesssp [][][]json.RawMessage `json:"datesssp"` graphql.NoMarshalJSON } fullObject.__CustomMarshalSliceInput = v { dst := &fullObject.Datesss src := v.Datesss *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 = testutil.MarshalDate( &src) if err != nil { return nil, fmt.Errorf( "Unable to marshal __CustomMarshalSliceInput.Datesss: %w", err) } } } } } { dst := &fullObject.Datesssp src := v.Datesssp *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 = testutil.MarshalDate( src) if err != nil { return nil, fmt.Errorf( "Unable to marshal __CustomMarshalSliceInput.Datesssp: %w", err) } } } } } return json.Marshal(&fullObject) } func CustomMarshalSlice( client graphql.Client, datesss [][][]time.Time, datesssp [][][]*time.Time, ) (*CustomMarshalSliceResponse, error) { __input := __CustomMarshalSliceInput{ Datesss: datesss, Datesssp: datesssp, } var err error var retval CustomMarshalSliceResponse err = client.MakeRequest( nil, "CustomMarshalSlice", ` query CustomMarshalSlice ($datesss: [[[Date!]!]!]!, $datesssp: [[[Date!]!]!]!) { acceptsListOfListOfListsOfDates(datesss: $datesss) withPointer: acceptsListOfListOfListsOfDates(datesss: $datesssp) } `, &retval, &__input, ) return &retval, err }