github.com/nathanstitt/genqlient@v0.3.1-0.20211028004951-a2bda3c41ab8/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go (about)

     1  package test
     2  
     3  // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
     4  
     5  import (
     6  	"github.com/Khan/genqlient/graphql"
     7  	"github.com/Khan/genqlient/internal/testutil"
     8  )
     9  
    10  // GetPokemonSiblingsResponse is returned by GetPokemonSiblings on success.
    11  type GetPokemonSiblingsResponse struct {
    12  	// user looks up a user by some stuff.
    13  	//
    14  	// See UserQueryInput for what stuff is supported.
    15  	// If query is null, returns the current user.
    16  	User GetPokemonSiblingsUser `json:"user"`
    17  }
    18  
    19  // GetUser returns GetPokemonSiblingsResponse.User, and is useful for accessing the field via an interface.
    20  func (v *GetPokemonSiblingsResponse) GetUser() GetPokemonSiblingsUser { return v.User }
    21  
    22  // GetPokemonSiblingsUser includes the requested fields of the GraphQL type User.
    23  // The GraphQL type's documentation follows.
    24  //
    25  // A User is a user!
    26  type GetPokemonSiblingsUser struct {
    27  	// id is the user's ID.
    28  	//
    29  	// It is stable, unique, and opaque, like all good IDs.
    30  	Id               string                                   `json:"id"`
    31  	Roles            []string                                 `json:"roles"`
    32  	Name             string                                   `json:"name"`
    33  	Pokemon          []testutil.Pokemon                       `json:"pokemon"`
    34  	GenqlientPokemon []GetPokemonSiblingsUserGenqlientPokemon `json:"genqlientPokemon"`
    35  }
    36  
    37  // GetId returns GetPokemonSiblingsUser.Id, and is useful for accessing the field via an interface.
    38  func (v *GetPokemonSiblingsUser) GetId() string { return v.Id }
    39  
    40  // GetRoles returns GetPokemonSiblingsUser.Roles, and is useful for accessing the field via an interface.
    41  func (v *GetPokemonSiblingsUser) GetRoles() []string { return v.Roles }
    42  
    43  // GetName returns GetPokemonSiblingsUser.Name, and is useful for accessing the field via an interface.
    44  func (v *GetPokemonSiblingsUser) GetName() string { return v.Name }
    45  
    46  // GetPokemon returns GetPokemonSiblingsUser.Pokemon, and is useful for accessing the field via an interface.
    47  func (v *GetPokemonSiblingsUser) GetPokemon() []testutil.Pokemon { return v.Pokemon }
    48  
    49  // GetGenqlientPokemon returns GetPokemonSiblingsUser.GenqlientPokemon, and is useful for accessing the field via an interface.
    50  func (v *GetPokemonSiblingsUser) GetGenqlientPokemon() []GetPokemonSiblingsUserGenqlientPokemon {
    51  	return v.GenqlientPokemon
    52  }
    53  
    54  // GetPokemonSiblingsUserGenqlientPokemon includes the requested fields of the GraphQL type Pokemon.
    55  type GetPokemonSiblingsUserGenqlientPokemon struct {
    56  	Species string `json:"species"`
    57  	Level   int    `json:"level"`
    58  }
    59  
    60  // GetSpecies returns GetPokemonSiblingsUserGenqlientPokemon.Species, and is useful for accessing the field via an interface.
    61  func (v *GetPokemonSiblingsUserGenqlientPokemon) GetSpecies() string { return v.Species }
    62  
    63  // GetLevel returns GetPokemonSiblingsUserGenqlientPokemon.Level, and is useful for accessing the field via an interface.
    64  func (v *GetPokemonSiblingsUserGenqlientPokemon) GetLevel() int { return v.Level }
    65  
    66  // __GetPokemonSiblingsInput is used internally by genqlient
    67  type __GetPokemonSiblingsInput struct {
    68  	Input testutil.Pokemon `json:"input"`
    69  }
    70  
    71  // GetInput returns __GetPokemonSiblingsInput.Input, and is useful for accessing the field via an interface.
    72  func (v *__GetPokemonSiblingsInput) GetInput() testutil.Pokemon { return v.Input }
    73  
    74  func GetPokemonSiblings(
    75  	client graphql.Client,
    76  	input testutil.Pokemon,
    77  ) (*GetPokemonSiblingsResponse, error) {
    78  	__input := __GetPokemonSiblingsInput{
    79  		Input: input,
    80  	}
    81  	var err error
    82  
    83  	var retval GetPokemonSiblingsResponse
    84  	err = client.MakeRequest(
    85  		nil,
    86  		"GetPokemonSiblings",
    87  		`
    88  query GetPokemonSiblings ($input: PokemonInput!) {
    89  	user(query: {hasPokemon:$input}) {
    90  		id
    91  		roles
    92  		name
    93  		pokemon {
    94  			species
    95  			level
    96  		}
    97  		genqlientPokemon: pokemon {
    98  			species
    99  			level
   100  		}
   101  	}
   102  }
   103  `,
   104  		&retval,
   105  		&__input,
   106  	)
   107  	return &retval, err
   108  }
   109