mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 13:24:14 +12:00
24 lines
530 B
Elixir
24 lines
530 B
Elixir
|
defmodule AshGraphql.Api do
|
||
|
defmacro __using__(opts) do
|
||
|
quote bind_quoted: [opts: opts] do
|
||
|
@mix_ins AshGraphql.Api
|
||
|
@authorize Keyword.get(opts, :authorize?, true)
|
||
|
@max_complexity Keyword.get(opts, :max_complexity, 50)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def before_compile_hook(_env) do
|
||
|
quote do
|
||
|
use AshGraphql.Api.Schema, resources: @resources, api: __MODULE__
|
||
|
|
||
|
def graphql_authorize? do
|
||
|
@authorize
|
||
|
end
|
||
|
|
||
|
def graphql_max_complexity() do
|
||
|
@max_complexity
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|