Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameFromIdentifier ¶
NameFromIdentifier makes a safe GraphQL type name from a field identifier.
Types ¶
type ArgDef ¶
ArgDef is a root-field argument. Declared marks arguments whose type came from a variable definition and therefore takes precedence over literals.
type Document ¶
Document is a parsed GraphQL document.
func ParseDocument ¶
ParseDocument parses a GraphQL document without executing it.
type Field ¶
type Field struct {
Alias string
Name string
Arguments []Argument
SelectionSet []*Field
FragmentSpreads []string
InlineFragments []*InlineFragment
}
Field is a selected GraphQL field.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator builds a GraphQL SDL schema from captured HTTP transactions.
func NewGenerator ¶
NewGenerator creates a GraphQL SDL generator.
func (*Generator) AddTransaction ¶
func (g *Generator) AddTransaction(transaction proxy.APITransaction)
AddTransaction adds a captured transaction. Non-GraphQL transactions are ignored by design.
type InlineFragment ¶
InlineFragment is an inline fragment selection.
type ObjectField ¶
ObjectField is a field in an object literal value.
type Operation ¶
type Operation struct {
Kind string
Name string
Variables []*VariableDef
SelectionSet []*Field
}
Operation is a query, mutation, or subscription operation.
type ParsedRequest ¶
ParsedRequest is a captured HTTP request identified as GraphQL.
func ParseRequest ¶
func ParseRequest(transaction proxy.APITransaction) (*ParsedRequest, bool)
ParseRequest detects and parses GraphQL carried by one captured HTTP transaction. Non-GraphQL traffic returns ok=false.
type TypeRef ¶
TypeRef is a GraphQL type reference. Elem is set for list types; Named is set for named and scalar types. NonNull applies to this node, not its child.
func ParseTypeReference ¶
ParseTypeReference parses a GraphQL type reference such as [User!]!.
type Value ¶
type Value struct {
Kind ValueKind
Text string
Bool bool
List []Value
Object []ObjectField
VarName string
}
Value is a GraphQL literal or variable reference.
type ValueKind ¶
type ValueKind string
ValueKind identifies the kind of a GraphQL argument or default value.
type VariableDef ¶
VariableDef declares a typed operation variable.