View Source GraphQLDocument.Directive (GraphQLDocument v0.2.2)

Directives provide a way to describe alternate runtime execution and type validation behavior in a GraphQL document.

A Directive might be simply a name, or it can have arguments. See render/1 for examples.

Link to this section Summary

Types

t()

A GraphQL directive.

Functions

Returns a list of directives as iodata to be inserted into a Document.

Link to this section Types

A GraphQL directive.

examples

Examples

:debug
[log: [level: "warn"]]

Link to this section Functions

@spec render([Directive.t()]) :: iolist()

Returns a list of directives as iodata to be inserted into a Document.

examples

Examples

iex> render([log: [level: "warn"]]) |> IO.iodata_to_binary()
" @log(level: \"warn\")"

iex> render([:debug]) |> IO.iodata_to_binary()
" @debug"