absinthe v1.2.0-beta.0 API Reference

Modules

Documentation for the Absinthe package, a toolkit for building GraphQL APIs with Elixir

Absinthe supports an adapter mechanism that allows developers to define their schema using one code convention (eg, snake_cased fields and arguments), but accept query documents and return results (including names in errors) in another (eg, camelCase)

This defines an adapter that supports GraphQL query documents in their conventional (in JS) camelcase notation, while allowing the schema to be defined using conventional (in Elixir) underscore (snakecase) notation, and tranforming the names as needed for lookups, results, and error messages

The default adapter, which makes no changes to incoming query document ASTs or outgoing results

A number of phases need to check for nil normalized values. This is problematic for situations where a value has been generated from a default value. This struct can be placed on the normalized value to indicate that it is not null, but also that it is not a proper blueprint input

An input in a document

Introspection support

Coerce variable string inputs to enums when appropriate

Populate all arguments in the document with their provided data values

Marks arguments as bad if they have any invalid children

Populate all arguments in the document with their provided values

Parses Leaf Node inputs

Ensure any nodes whose children are invalid that need to be made invalid is marked invalid

Selects the current operation

Expand all directives in the document

Executes a blueprint

Runs resolution functions in a new blueprint

Flatten inline fragment contents and named fragments (via fragment spreads) from operation and field selections into their fields list. Resulting fields are tagged with the source fragment type conditions

Fills out missing arguments and input object fields

Fills out missing arguments and input object fields

Produces data fit for external encoding from annotated value tree

Tracks uses of:

  • Variables
  • Fragments

Validates document to ensure that all arguments are of the correct type

Validates document to ensure that all fields are provided on the correct type

Validates document to ensure that all arguments are in the schema

Validates document to ensure that only fragment spreads reference named fragments that exist

Validates document to ensure that only one operation is provided without a name

Ensure that document doesn’t have any fragment cycles that could result in a loop during execution

Validates document to ensure that the only variables that are used in a document are defined on the operation

Validates document to ensure that all named fragments are used

Validates document to ensure that the only variables that are used in a document are defined on the operation

Validates document to ensure that at least one operation is given

Validates document to ensure that all non-null arguments are provided

Collects validation errors into the result

Validates that all leaf nodes are scalars

Validates an operation name was provided when needed

Validates document to ensure that all arguments for a field or directive have unique names

Validates document to ensure that all fragments have unique names

Validates document to ensure that all input fields have unique names

Validates document to ensure that all operations have unique names

Validates document to ensure that all variable definitions for an operation have unique names

Validates document to ensure that all variable definitions are for input types

Provided a set of variable values

Populate all schema nodes and the adapter for the blueprint tree. If the blueprint tree is a schema tree, this schema is the meta schema (source of IDL directives, etc)

Ensure type names actually exist in the schema

A basic struct that wraps phase errors for reporting to the user

The primary piece of metadata passed to aid resolution functions, describing the current field’s execution environment

Define a GraphQL schema

This module contains macros used to build GraphQL types

Used to define an argument

Built in data types

Used by the GraphQL runtime as a way of modifying execution behavior

Used to define an enum type, a special scalar that can only have a defined set of values

A possible value for an enum

Used to define a field

Defines a GraphQL input object

A defined interface type that represent a list of named fields and their arguments

A wrapping type which declares the type of each item in the list

A type that wraps an underlying type, acting identically to that type but adding a non-null constraint

Represents a non-leaf node in a GraphQL tree of information

Represents a primitive value

A unions is an abstract type made up of multiple possible concrete types

Generate a schema.json file

Exceptions

An error during execution

Exception raised when a schema is invalid

Exception raised when a schema is invalid

Protocols