Skip to content

Instantly share code, notes, and snippets.

@bruce
Created June 21, 2017 05:24
Show Gist options
  • Save bruce/9ef9afd4654f83fd0d4018a159db8e90 to your computer and use it in GitHub Desktop.
Save bruce/9ef9afd4654f83fd0d4018a159db8e90 to your computer and use it in GitHub Desktop.
Use of import_types and import_fields
defmodule MyApp.Web.Schema.Types.Company do
use Absinthe.Schema.Notation
object :company_queries do
field :companies, list_of(:company) do
# ...
end
field :company, type: :company do
# ...
end
end
end
defmodule MyApp.Web.Schema do
use Absinthe.Schema
import_types MyApp.Web.Schema.Types.Company
query do
import_fields :company_queries
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment