GraphQL.QueryRegistry (GraphQL Client v0.2.1) View Source
Functions to handle query registries.
A query registry stores several GraphQL.Query structs, so they
can be combined into a single query before the execution.
Link to this section Summary
Types
A resolver is a function that must accept two arguments
A struct that keeps the information about several queries, variables and resolvers.
Functions
Add a query to the a query registry
Add a new resolver into a query registry
Add a list of resolvers into a query registry
Executes the given query registry, using the given accumulator acc and the given options
Creates a new QueryRegistry struct with the given name.
Link to this section Types
Specs
A resolver is a function that must accept two arguments:
- a
GraphQL.Responsestruct - an accumulator, that can be of any type
It also must return the updated value of the accumulator.
Specs
t() :: %GraphQL.QueryRegistry{
name: String.t(),
queries: [GraphQL.Query.t()],
resolvers: list(),
variables: [map()]
}
A struct that keeps the information about several queries, variables and resolvers.
The name field will be used as the name of the final query or mutation.
The queries field is a list of GraphQL.Query structs, that
will be merged before execution.
The variables is a map with all values of variables that will be sent
to the server along with the GraphQL body.
The resolver is a list of t:resolver() functions that can be used to
produce the side effects in an accumulator.
Link to this section Functions
Specs
add_query(t(), GraphQL.Query.t(), map()) :: t()
Add a query to the a query registry
Specs
Add a new resolver into a query registry
Specs
Add a list of resolvers into a query registry
Specs
Executes the given query registry, using the given accumulator acc and the given options
Specs
Creates a new QueryRegistry struct with the given name.