Created
November 29, 2018 15:23
-
-
Save benwilson512/6773842cd832214e7ac11741dc56e8a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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