We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The problem is when publishing a value it will return null on the subscribe method
export const subscriptions = model => ({ [model]: { resolve(payload) { console.log({...payload[model]}) return {...payload[model]} }, subscribe: withFilter(() => pubsub.asyncIterator( ['CREATED','UPDATED', 'DELETED'] .map(mutation => `${model.toUpperCase()}_${mutation}`)), (payload,variables) => { return payload.id === variables.id }) } })
And publishing it like this
[`update${model}`]: async(_, { id, ...args }, { models }, info) => { let result = await models[model].findById(id) await result.update(args) pubsub.publish(`${model.toUpperCase()}_UPDATED`, { [model]: args }) return result },
this is what i get received from the Subscription resolve
[nodemon] starting `babel-node src` Server started at 0.0.0.0:8080 express deprecated req.host: Use req.hostname instead src/server.js:97:88 { name: 'testerssas', description: 'test', slug: 'testerssas', fee: 0 } POST /graphql 200 59.101 ms - -
and getting this error
Noticed that [object Object] is an error
The text was updated successfully, but these errors were encountered:
I think the problem is not returning an id on the publish but doing rather sending the args
Sorry, something went wrong.
No branches or pull requests
The problem is when publishing a value it will return null on the subscribe method
And publishing it like this
this is what i get received from the Subscription resolve
and getting this error
Noticed that [object Object] is an error
The text was updated successfully, but these errors were encountered: