Documentation ¶
Index ¶
- func NewArgument(name string, val *Value) *argument
- func NewObjectValueField(fieldName string, value *Value) *objectValueField
- func NewVariableDefinition(name string, varType string, required bool, defaultVal *Value) *variableDefinition
- func WithAlias(alias string) selectionOption
- func WithArguments(args ...*argument) selectionOption
- func WithName(name string) operationOption
- func WithVariableDefinitions(vars ...*variableDefinition) operationOption
- type Selection
- func (s *Selection) Fragment(name, typeCondition string) *Selection
- func (s *Selection) FragmentSpread(name string) *Selection
- func (s *Selection) InlineFragment(typeCondition string) *Selection
- func (s *Selection) Parent() *Selection
- func (s *Selection) Root() *Selection
- func (s *Selection) Scalar(fieldName string, options ...selectionOption) *Selection
- func (s *Selection) Selection(fieldName string, options ...selectionOption) *Selection
- func (s *Selection) String() string
- type Value
- func NewBooleanValue(val bool) *Value
- func NewEnumValue(val string) *Value
- func NewFloatValue(val float64) *Value
- func NewIntValue(val int) *Value
- func NewListValue(values ...*Value) *Value
- func NewObjectValue(values ...*objectValueField) *Value
- func NewStringValue(val string) *Value
- func NewVariableValue(name string) *Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewArgument ¶
NewArgument constructs a new argument with a value
func NewObjectValueField ¶
NewObjectValueField returns a field for an object value
func NewVariableDefinition ¶
func NewVariableDefinition(name string, varType string, required bool, defaultVal *Value) *variableDefinition
NewVariableDefinition defines a new variable definition
func WithAlias ¶
func WithAlias(alias string) selectionOption
WithAlias is an option for specifying a selection alias
func WithArguments ¶
func WithArguments(args ...*argument) selectionOption
WithArguments is a selection option for specifying arguments
func WithName ¶
func WithName(name string) operationOption
WithName specifies a name for the operation
func WithVariableDefinitions ¶
func WithVariableDefinitions(vars ...*variableDefinition) operationOption
WithVariableDefinitions is an operation option for declaring variable definitions
Types ¶
type Selection ¶
type Selection struct {
// contains filtered or unexported fields
}
func NewMutation ¶
func NewMutation(options ...operationOption) *Selection
NewMutation returns a selection builder for a new GraphQL mutation. mutation { ... }
func NewQuery ¶
func NewQuery(options ...operationOption) *Selection
NewQuery returns a selection builder for a new GraphQL query. query { ... }
func (*Selection) FragmentSpread ¶
FragmentSpread adds a fragement spread
func (*Selection) InlineFragment ¶
InlineFragment adds an inline fragment to the current selection
func (*Selection) Parent ¶
Parent returns the parent of this selection. If it's the root, will return nil.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents a GraphQL value
func NewBooleanValue ¶
NewBooleanValue returns a boolean value
func NewObjectValue ¶
func NewObjectValue(values ...*objectValueField) *Value
NewObjectValue returns an object value
func NewVariableValue ¶
NewVariableValue returns a variable value