Created
January 10, 2017 23:38
-
-
Save benwilson512/2887f63b6ff98c1dcd9816e26637930f 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
mutation do | |
field :submit_comment, :comment do | |
arg :repo_fullname, non_null(:string) | |
arg :content, non_null(:string) | |
resolve fn args, _ -> | |
comment = # create comment | |
{:ok, comment} | |
end | |
end | |
end | |
subscription do | |
field :comment_added, :comment do | |
arg :repo_fullname, non_null(:string) | |
trigger :submit_comment do | |
# filter fn comment, args -> | |
# comment.repository_name == args.repo_fullname | |
# end | |
subscription_key fn args -> | |
args.repo_fullname | |
end | |
mutation_key fn comment -> | |
comment.repository_name | |
end | |
end | |
resolve fn message, _, _ -> | |
{:ok, message} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment