Last active
March 21, 2018 22:00
-
-
Save smoak/e64655c547d29426b914fa2634159eb6 to your computer and use it in GitHub Desktop.
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
query { | |
user(id: "12345") { | |
id | |
} | |
viewer { | |
user { | |
id | |
} | |
} | |
} |
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 Schema do | |
object :user do | |
field :id, non_null(:id) | |
end | |
object :viewer do | |
field :user, :user | |
end | |
query do | |
field :viewer, :viewer do | |
resolve(&Resolvers.Viewer.resolve/3) | |
end | |
field :user, :user do | |
arg(:id, non_null(:string)) | |
resolve(&Resolvers.User.resolve/3) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment