Skip to content

Commit

Permalink
fix: NewMessage mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Nov 14, 2019
1 parent 628780a commit 3c9428e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/daf-core/src/graphql-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ interface Context {
core: Core
}

const newMessage = async (_: any, args: { raw: string }, ctx: Context) => {
return await ctx.core.onRawMessage({ raw: args.raw })
const newMessage = async (_: any, args: { raw: string, sourceType: string, sourceId?: string }, ctx: Context) => {
return await ctx.core.onRawMessage({
raw: args.raw,
meta: [{
sourceType: args.sourceType,
sourceId: args.sourceId
}]
})
}

export const resolvers = {
Expand All @@ -16,6 +22,6 @@ export const resolvers = {

export const typeDefs = `
extend type Mutation {
newMessage(raw: String): Message
newMessage(raw: String!, sourceType: String!, sourceId: String): Message
}
`

0 comments on commit 3c9428e

Please sign in to comment.