Documentation ¶
Index ¶
- func WithPackage(name string) func(*Generator)
- func WithScalarBindings(bindings map[string]string) func(*Generator)
- func WithSource(filename string) func(*Generator)
- type Argument
- type EnumData
- type Errors
- type FieldData
- type FileData
- type Function
- type FunctionData
- type Generator
- type GraphQLRequest
- type InputData
- type OperationData
- type Option
- type ScalarBinding
- type ScalarData
- type TypeData
- type UnionData
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPackage ¶
func WithScalarBindings ¶
func WithSource ¶ added in v0.2.0
Types ¶
type Errors ¶
type Errors struct { Message string `json:"message,omitempty"` Locations []struct { Line int `json:"line"` Column int `json:"column"` } `json:"locations,omitempty"` Extensions map[string]interface{} `json:"extensions,omitempty"` }
Errors is a response field to capture server reported problems
type FileData ¶
type FileData struct { Package string BuildVersion string Types []TypeData Enums []EnumData Mutations []OperationData Queries []OperationData Scalars []ScalarData Functions []FunctionData Unions []UnionData Inputs []InputData IncludeScalarID bool SchemaVersion string }
type FunctionData ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
type GraphQLRequest ¶
type GraphQLRequest struct { Query string `json:"query"` OperationName string `json:"operationName"` Variables map[string]interface{} `json:"variables"` }
GraphQLRequest is used to model both a query or a mutation request
Example ¶
request := GraphQLRequest{} requestBytes, _ := json.Marshal(request) requestReader := bytes.NewReader(requestBytes) _, _ = http.Post("http://your.service/api", "application/json", requestReader)
Output:
func NewGraphQLRequest ¶
func NewGraphQLRequest(query, operation string, vars ...map[string]interface{}) GraphQLRequest
NewGraphQLRequest returns a new Request (for query or mutation) with optional or empty variables.
type OperationData ¶
type ScalarBinding ¶
type ScalarData ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.