github.com/codykaup/genqlient@v0.6.2/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go (about)

     1  // Code generated by github.com/codykaup/genqlient, DO NOT EDIT.
     2  
     3  package test
     4  
     5  import (
     6  	"github.com/codykaup/genqlient/graphql"
     7  	"github.com/codykaup/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  // The query or mutation executed by GetPokemonSiblings.
    75  const GetPokemonSiblings_Operation = `
    76  query GetPokemonSiblings ($input: PokemonInput!) {
    77  	user(query: {hasPokemon:$input}) {
    78  		id
    79  		roles
    80  		name
    81  		pokemon {
    82  			species
    83  			level
    84  		}
    85  		genqlientPokemon: pokemon {
    86  			species
    87  			level
    88  		}
    89  	}
    90  }
    91  `
    92  
    93  func GetPokemonSiblings(
    94  	client_ graphql.Client,
    95  	input testutil.Pokemon,
    96  ) (*GetPokemonSiblingsResponse, error) {
    97  	req_ := &graphql.Request{
    98  		OpName: "GetPokemonSiblings",
    99  		Query:  GetPokemonSiblings_Operation,
   100  		Variables: &__GetPokemonSiblingsInput{
   101  			Input: input,
   102  		},
   103  	}
   104  	var err_ error
   105  
   106  	var data_ GetPokemonSiblingsResponse
   107  	resp_ := &graphql.Response{Data: &data_}
   108  
   109  	err_ = client_.MakeRequest(
   110  		nil,
   111  		req_,
   112  		resp_,
   113  	)
   114  
   115  	return &data_, err_
   116  }
   117