Created
June 11, 2020 07:36
-
-
Save velotiotech/c39344c524d9c6d2b71440eb983f42dd 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 | |
mutation do | |
field :create_post, type: :blog_post do | |
arg(:title, non_null(:string)) | |
arg(:body, non_null(:string)) | |
arg(:accounts_user_id, non_null(:id)) | |
resolve(&Graphql.Blog.PostResolver.create/2) | |
end | |
field :update_post, type: :blog_post do | |
arg(:id, non_null(:id)) | |
arg(:post, :update_post_params) | |
resolve(&Graphql.Blog.PostResolver.update/2) | |
end | |
field :delete_post, type: :blog_post do | |
arg(:id, non_null(:id)) | |
resolve(&Graphql.Blog.PostResolver.delete/2) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment