Packages
absinthe_relay
1.5.0-alpha.0
1.6.0
1.5.2
1.5.1
1.5.0
1.5.0-rc.0
1.5.0-beta.0
1.5.0-alpha.0
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.4.0-rc.1
1.4.0-rc.0
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.3.0-rc.0
1.3.0-beta.1
1.3.0-beta.0
1.2.0
1.2.0-alpha0
1.2.0-alpha.3
1.2.0-alpha.2
1.2.0-alpha.1
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.1
0.8.0
Relay framework support for Absinthe
Current section
Files
Jump to
Current section
Files
lib/absinthe/relay/schema.ex
defmodule Absinthe.Relay.Schema do
@moduledoc """
Used to extend a schema with Relay-specific macros and types.
See `Absinthe.Relay`.
"""
defmacro __using__(flavor) when is_atom(flavor) do
do_using(flavor, [])
end
defmacro __using__(opts) when is_list(opts) do
opts
|> Keyword.get(:flavor, [])
|> do_using(opts)
end
defp do_using(flavor, opts) do
quote do
@pipeline_modifier unquote(__MODULE__)
use Absinthe.Relay.Schema.Notation, unquote(flavor)
import_types Absinthe.Relay.Connection.Types
def __absinthe_relay_global_id_translator__ do
Keyword.get(unquote(opts), :global_id_translator)
end
end
end
def pipeline(pipeline) do
pipeline
|> Absinthe.Pipeline.insert_after(Absinthe.Phase.Schema.TypeImports, __MODULE__.Phase)
end
end