Documentation ¶
Index ¶
- func ApplySelectionSet(schema *internal.Schema, document *internal.Document, operationName string, ...) (ast.OperationType, *internal.SelectionSet, error)
- func Do(schema *internal.Schema, param Params) (interface{}, errors.MultiError)
- func Flatten(selectionSet *internal.SelectionSet) ([]*internal.Selection, error)
- type Executor
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySelectionSet ¶
func Flatten ¶
func Flatten(selectionSet *internal.SelectionSet) ([]*internal.Selection, error)
Flatten takes a SelectionSet and flattens it into an array of selections with unique aliases
A GraphQL query (the SelectionSet) is allowed to contain the same key multiple times, as well as fragments. For example,
{ groups { name } groups { name id } ... on Organization { groups { widgets { name } } } }
Flatten simplifies the query into an array of selections, merging fields, resulting in something like the new query
groups: { name name id { widgets { name } } }
Flatten does _not_ flatten out the inner queries, so the name above does not get flattened out yet.
Types ¶
Click to show internal directories.
Click to hide internal directories.