View Source GraphQLDocument.Operation (GraphQLDocument v0.2.0)
Link to this section Summary
Types
Options that can be passed along with the operation.
Functions
Generates GraphQL syntax from a nested Elixir keyword list.
Link to this section Types
@type operation_type() :: :query | :mutation | :subscription
@type option() :: {:variables, [GraphQLDocument.Variable.definition()]} | {:fragments, [GraphQLDocument.Fragment.definition()]} | {:directives, [GraphQLDocument.Directive.t()]}
Options that can be passed along with the operation.
Link to this section Functions
@spec render(operation_type(), [GraphQLDocument.Selection.t()], [option()]) :: String.t()
Generates GraphQL syntax from a nested Elixir keyword list.
example
Example
iex> render(:query,
...> user: {[id: 3], [
...> :name,
...> :age,
...> :height, documents: [:filename, :url]]})
...> documents: [
...> :filename, :url]]})
...> :url]]})
...> ]]})
...> ]}
...> )
"""
query {
user(id: 3) {
name
age
height
documents {
filename
url
}
}
}\
"""