mix absinthe.gen.schema (absinthe_generator v0.1.2) View Source
Generates an Absinthe Schema
Options
:app_name
(String.t/0
) - Required. Application name you're generating the code under:moduledoc
(String.t/0
) - Moduledoc message can be injected into the resulting output code:queries
(list ofString.t/0
) - List of query namespaces The default value is[]
.:mutations
(list ofString.t/0
) - List of mutation namespaces The default value is[]
.:subscriptions
(list ofString.t/0
) - List of subscription namespaces The default value is[]
.:types
(list ofString.t/0
) - List of types The default value is[]
.:data_sources
(list ofkeyword/0
) - List of %AbsintheGenerator.Schema.DataSource
{} The default value is[]
.:pre_middleware
(list ofkeyword/0
) - List of %AbsintheGenerator.Schema.Middleware
{} The default value is[]
.:post_middleware
(list ofkeyword/0
) - List of %AbsintheGenerator.Schema.Middleware
{} The default value is[]
.
Specifying Middleware
To specify middleware we can utilize the following syntax
pre_middleware:mutation:AuthMiddleware post_middleware:all:ChangesetErrorFormatter
Middleware can be set for mutation
, query
, subscription
or all
and can
also be set to either run pre or post resolution using pre_middleware
or post_middleware
Example
mix absinthe.gen.schema pre_middleware:mutation:MyMiddlwareModule post_middleware:all:MyAllMiddleware
--app-name MyApp
--query test
--query user
--mutation user
--mutation session
--type MyApp
--moduledoc "this is the test"
--data-source "EctoSchemas.Cats"
Link to this section Summary
Functions
Callback implementation for Mix.Task.run/1
.
Link to this section Functions
Callback implementation for Mix.Task.run/1
.