Skip to content

Instantly share code, notes, and snippets.

@benwilson512
Created November 29, 2018 15:23
Show Gist options
  • Save benwilson512/6773842cd832214e7ac11741dc56e8a7 to your computer and use it in GitHub Desktop.
Save benwilson512/6773842cd832214e7ac11741dc56e8a7 to your computer and use it in GitHub Desktop.
defmodule MyApp.AddFilteringTypes do
def run(blueprint, _) do
{:ok, blueprint}
end
end
defmodule Schema do
use Absinthe.Schema
@pipeline_modifier __MODULE__
object :instance do
field :name, :string
end
object :snapshot do
field :instance, :instance
end
query do
field :health, :string
field :instances, list_of(:instance) do
meta :fancy_filter
end
end
def pipeline(pipeline) do
Absinthe.Pipeline.insert_after
pipeline,
Absinthe.Phase.Schema.TypeImports,
MyApp.AddFilteringTypes
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment