Created
June 11, 2020 07:35
-
-
Save velotiotech/dc1fed4d21e383e4a7203df36060e18f 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 GraphqlWeb.Schema do | |
use Absinthe.Schema | |
import_types(GraphqlWeb.Schema.Types) | |
query do | |
field :blog_posts, list_of(:blog_post) do | |
resolve(&Graphql.Blog.PostResolver.all/2) | |
end | |
field :blog_post, type: :blog_post do | |
arg(:id, non_null(:id)) | |
resolve(&Graphql.Blog.PostResolver.find/2) | |
end | |
field :accounts_users, list_of(:accounts_user) do | |
resolve(&Graphql.Accounts.UserResolver.all/2) | |
end | |
field :accounts_user, :accounts_user do | |
arg(:email, non_null(:string)) | |
resolve(&Graphql.Accounts.UserResolver.find/2) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment