Created
June 21, 2017 05:24
-
-
Save bruce/9ef9afd4654f83fd0d4018a159db8e90 to your computer and use it in GitHub Desktop.
Use of import_types and import_fields
This file contains hidden or 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.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 |
This file contains hidden or 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.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