Last active
March 3, 2018 12:57
-
-
Save akoenig/deab2152a53c1649d7e1d03375cc0727 to your computer and use it in GitHub Desktop.
Medium: M2M in GraphQL context (Invite Mutation)
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
interface InviteInput { | |
input: { | |
email: string; | |
message?: string; | |
} | |
} | |
const invite = async (parent, args: InviteInput, context: Context, info) => { | |
await context.messaging.publish({ | |
type: "Invite", | |
payload: { | |
email: args.input.email, | |
message: args.input.message | |
} | |
}); | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment