github.com/codykaup/genqlient@v0.6.2/generate/testdata/snapshots/TestGenerate-QueryWithStructs.graphql-QueryWithStructs.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  )
     8  
     9  // QueryWithStructsResponse is returned by QueryWithStructs on success.
    10  type QueryWithStructsResponse struct {
    11  	// user looks up a user by some stuff.
    12  	//
    13  	// See UserQueryInput for what stuff is supported.
    14  	// If query is null, returns the current user.
    15  	User QueryWithStructsUser `json:"user"`
    16  }
    17  
    18  // GetUser returns QueryWithStructsResponse.User, and is useful for accessing the field via an interface.
    19  func (v *QueryWithStructsResponse) GetUser() QueryWithStructsUser { return v.User }
    20  
    21  // QueryWithStructsUser includes the requested fields of the GraphQL type User.
    22  // The GraphQL type's documentation follows.
    23  //
    24  // A User is a user!
    25  type QueryWithStructsUser struct {
    26  	AuthMethods []QueryWithStructsUserAuthMethodsAuthMethod `json:"authMethods"`
    27  }
    28  
    29  // GetAuthMethods returns QueryWithStructsUser.AuthMethods, and is useful for accessing the field via an interface.
    30  func (v *QueryWithStructsUser) GetAuthMethods() []QueryWithStructsUserAuthMethodsAuthMethod {
    31  	return v.AuthMethods
    32  }
    33  
    34  // QueryWithStructsUserAuthMethodsAuthMethod includes the requested fields of the GraphQL type AuthMethod.
    35  type QueryWithStructsUserAuthMethodsAuthMethod struct {
    36  	Provider string `json:"provider"`
    37  	Email    string `json:"email"`
    38  }
    39  
    40  // GetProvider returns QueryWithStructsUserAuthMethodsAuthMethod.Provider, and is useful for accessing the field via an interface.
    41  func (v *QueryWithStructsUserAuthMethodsAuthMethod) GetProvider() string { return v.Provider }
    42  
    43  // GetEmail returns QueryWithStructsUserAuthMethodsAuthMethod.Email, and is useful for accessing the field via an interface.
    44  func (v *QueryWithStructsUserAuthMethodsAuthMethod) GetEmail() string { return v.Email }
    45  
    46  // The query or mutation executed by QueryWithStructs.
    47  const QueryWithStructs_Operation = `
    48  query QueryWithStructs {
    49  	user {
    50  		authMethods {
    51  			provider
    52  			email
    53  		}
    54  	}
    55  }
    56  `
    57  
    58  func QueryWithStructs(
    59  	client_ graphql.Client,
    60  ) (*QueryWithStructsResponse, error) {
    61  	req_ := &graphql.Request{
    62  		OpName: "QueryWithStructs",
    63  		Query:  QueryWithStructs_Operation,
    64  	}
    65  	var err_ error
    66  
    67  	var data_ QueryWithStructsResponse
    68  	resp_ := &graphql.Response{Data: &data_}
    69  
    70  	err_ = client_.MakeRequest(
    71  		nil,
    72  		req_,
    73  		resp_,
    74  	)
    75  
    76  	return &data_, err_
    77  }
    78