View Source AbsintheQueryAll (absinthe_query_all v0.5.0)

Documentation for AbsintheQueryAll.

Summary

Functions

Gets a complete list of all possible operations for the specified operation type (i.e. query, mutation, or subscription).

Runs a query for the specified operation, requesting every possible field in the response.

Functions

Link to this function

get_all_operations(schema, operation_type)

View Source
@spec get_all_operations(
  Absinthe.Schema.t(),
  AbsintheQueryAll.Query.Operations.operation_type()
) :: [
  atom()
]

Gets a complete list of all possible operations for the specified operation type (i.e. query, mutation, or subscription).

Examples

iex> AbsintheQueryAll.get_all_operations(TestAbsintheSchema, :query)
[
  :badTestQuery, :testQuery, :theNumberOneQuery
]
Link to this function

get_comprehensive_response(config)

View Source
@spec get_comprehensive_response(%{
  :operation_type => AbsintheQueryAll.Query.Operations.operation_type(),
  :operation_name => atom(),
  :schema => Absinthe.Schema.t(),
  optional(:context) => any(),
  optional(:permitted_fields) =>
    AbsintheQueryAll.Query.Fields.permitted_fields(),
  optional(:parent_alias_generator) => (atom(),
                                        [
                                          AbsintheQueryAll.Query.Arguments.arg_data()
                                        ] ->
                                          any()),
  optional(:leaf_alias_generator) => (atom(),
                                      AbsintheQueryAll.Query.Types.details() ->
                                        any()),
  optional(:argument_generator) => (atom(), atom() -> map())
}) :: {:error, binary()} | {:ok, map()}

Runs a query for the specified operation, requesting every possible field in the response.

Examples

iex> AbsintheQueryAll.get_comprehensive_response(%{
...>   schema: TestAbsintheSchema,
...>   operation_type: :query,
...>   operation_name: :theNumberOneQuery,
...> })
{:ok, %{data: %{"theNumberOneQuery" => 1}}}