absinthe v1.4.0-beta.1 Absinthe.Adapter.Passthrough View Source

The default adapter, which makes no changes to incoming query document ASTs or outgoing results.

Link to this section Summary

Functions

Convert a name from an internal name to an external name

Convert a name from an external name to an internal name

Link to this section Functions

Link to this function to_external_name(internal_name, role) View Source

Convert a name from an internal name to an external name.

Examples

Remove the role-prefix (the inverse of what we did in to_internal_name/2 above):

def to_external_name(internal_name, role) do
  internal_name
  |> String.replace(~r/^#{role}_/, "")
end

Callback implementation for Absinthe.Adapter.to_external_name/2.

Link to this function to_internal_name(external_name, role) View Source

Convert a name from an external name to an internal name.

Examples

Prefix all names with their role, just for fun!

def to_internal_name(external_name, role) do
  role_name = role |> to_string
  role_name <> "_" <> external_name
end

Callback implementation for Absinthe.Adapter.to_internal_name/2.