Skip to content

Instantly share code, notes, and snippets.

@akoenig
Last active March 3, 2018 12:57
Show Gist options
  • Save akoenig/deab2152a53c1649d7e1d03375cc0727 to your computer and use it in GitHub Desktop.
Save akoenig/deab2152a53c1649d7e1d03375cc0727 to your computer and use it in GitHub Desktop.
Medium: M2M in GraphQL context (Invite Mutation)
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