587f77046b
This allows client code to see the operation (query or mutation) exactly
as genqlient sends it over the wire. This data was already available in
the generated safelist.json file, but now it's easily available from Go
code as well.
Fixes #236
I have:
- [x] Written a clear PR title and description (above)
- [x] Signed the [Khan Academy CLA](https://www.khanacademy.org/r/cla)
- [x] Added tests covering my changes, if applicable
- [x] Included a link to the issue fixed, if applicable
- [x] Included documentation, for new features
- [x] Added an entry to the changelog
111 lines
3.4 KiB
Go
111 lines
3.4 KiB
Go
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
|
|
|
|
package test
|
|
|
|
import (
|
|
"github.com/Khan/genqlient/graphql"
|
|
"github.com/Khan/genqlient/internal/testutil"
|
|
)
|
|
|
|
// RecursionRecurRecursive includes the requested fields of the GraphQL type Recursive.
|
|
type RecursionRecurRecursive struct {
|
|
Rec RecursionRecurRecursiveRecRecursive `json:"rec"`
|
|
}
|
|
|
|
// GetRec returns RecursionRecurRecursive.Rec, and is useful for accessing the field via an interface.
|
|
func (v *RecursionRecurRecursive) GetRec() RecursionRecurRecursiveRecRecursive { return v.Rec }
|
|
|
|
// RecursionRecurRecursiveRecRecursive includes the requested fields of the GraphQL type Recursive.
|
|
type RecursionRecurRecursiveRecRecursive struct {
|
|
Rec RecursionRecurRecursiveRecRecursiveRecRecursive `json:"rec"`
|
|
}
|
|
|
|
// GetRec returns RecursionRecurRecursiveRecRecursive.Rec, and is useful for accessing the field via an interface.
|
|
func (v *RecursionRecurRecursiveRecRecursive) GetRec() RecursionRecurRecursiveRecRecursiveRecRecursive {
|
|
return v.Rec
|
|
}
|
|
|
|
// RecursionRecurRecursiveRecRecursiveRecRecursive includes the requested fields of the GraphQL type Recursive.
|
|
type RecursionRecurRecursiveRecRecursiveRecRecursive struct {
|
|
Rec RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive `json:"rec"`
|
|
}
|
|
|
|
// GetRec returns RecursionRecurRecursiveRecRecursiveRecRecursive.Rec, and is useful for accessing the field via an interface.
|
|
func (v *RecursionRecurRecursiveRecRecursiveRecRecursive) GetRec() RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive {
|
|
return v.Rec
|
|
}
|
|
|
|
// RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive includes the requested fields of the GraphQL type Recursive.
|
|
type RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive struct {
|
|
Id testutil.ID `json:"id"`
|
|
}
|
|
|
|
// GetId returns RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive.Id, and is useful for accessing the field via an interface.
|
|
func (v *RecursionRecurRecursiveRecRecursiveRecRecursiveRecRecursive) GetId() testutil.ID {
|
|
return v.Id
|
|
}
|
|
|
|
// RecursionResponse is returned by Recursion on success.
|
|
type RecursionResponse struct {
|
|
Recur RecursionRecurRecursive `json:"recur"`
|
|
}
|
|
|
|
// GetRecur returns RecursionResponse.Recur, and is useful for accessing the field via an interface.
|
|
func (v *RecursionResponse) GetRecur() RecursionRecurRecursive { return v.Recur }
|
|
|
|
type RecursiveInput struct {
|
|
Rec []RecursiveInput `json:"rec"`
|
|
}
|
|
|
|
// GetRec returns RecursiveInput.Rec, and is useful for accessing the field via an interface.
|
|
func (v *RecursiveInput) GetRec() []RecursiveInput { return v.Rec }
|
|
|
|
// __RecursionInput is used internally by genqlient
|
|
type __RecursionInput struct {
|
|
Input RecursiveInput `json:"input"`
|
|
}
|
|
|
|
// GetInput returns __RecursionInput.Input, and is useful for accessing the field via an interface.
|
|
func (v *__RecursionInput) GetInput() RecursiveInput { return v.Input }
|
|
|
|
// The query or mutation executed by Recursion.
|
|
const RecursionOperation = `
|
|
query Recursion ($input: RecursiveInput!) {
|
|
recur(input: $input) {
|
|
rec {
|
|
rec {
|
|
rec {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
func Recursion(
|
|
client graphql.Client,
|
|
input RecursiveInput,
|
|
) (*RecursionResponse, error) {
|
|
req := &graphql.Request{
|
|
OpName: "Recursion",
|
|
Query: RecursionOperation,
|
|
Variables: &__RecursionInput{
|
|
Input: input,
|
|
},
|
|
}
|
|
var err error
|
|
|
|
var data RecursionResponse
|
|
resp := &graphql.Response{Data: &data}
|
|
|
|
err = client.MakeRequest(
|
|
nil,
|
|
req,
|
|
resp,
|
|
)
|
|
|
|
return &data, err
|
|
}
|
|
|