absinthe_plug v1.3.0-beta.1 Absinthe.Plug.DocumentProvider behaviour
A document provider is a module that, given a GraphQL request, determines what document should be executed and how the configured pipeline should be applied to that document.
Configuring
Configuration of your document providers occurs on initialization of
Absinthe.Plug
; see that module’s documentation of the :document_providers
option for more details.
Making Your Own
Absinthe.Plug.DocumentProvider
is a behaviour, and any module that
implements its callbacks can function as a document provider for
Absinthe.Plug
.
See the documentation for the behaviour callbacks and the implementation of the document providers that are defined in this package for more information.
Summary
Types
When the request is not handled by this document provider (so processing should continue to the next one)
A configuration for a document provider, which can take two forms
Callbacks
Given a request, determine what part of its configured pipeline should be applied during execution
Given a request, attempt to process it with this document provider
Types
When the request is not handled by this document provider (so processing should continue to the next one):
{:cont, Absinthe.Plug.Request.t}
When the request has been processed by this document provider:
{:halt, Absinthe.Plug.Request.t}
Note that if no document providers set the request document
, no document execution
will occur and an error will be returned to the client.
A configuration for a document provider, which can take two forms:
module
when options do not need to be passed to the document provider.{module, Keyword.t}
when options are needed by the document provider.
Callbacks
Given a request, determine what part of its configured pipeline should be applied during execution.