{"action":"opened","issue":{"url":"https://api.github.com/repos/apollographql/graphql-subscriptions/issues/96","repository_url":"https://api.github.com/repos/apollographql/graphql-subscriptions","labels_url":"https://api.github.com/repos/apollographql/graphql-subscriptions/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/graphql-subscriptions/issues/96/comments","events_url":"https://api.github.com/repos/apollographql/graphql-subscriptions/issues/96/events","html_url":"https://github.com/apollographql/graphql-subscriptions/issues/96","id":247793764,"number":96,"title":"[object Object] Result when doing pubsub.publish","user":{"login":"ralphchristianeclipse","id":25447231,"avatar_url":"https://avatars1.githubusercontent.com/u/25447231?v=4","gravatar_id":"","url":"https://api.github.com/users/ralphchristianeclipse","html_url":"https://github.com/ralphchristianeclipse","followers_url":"https://api.github.com/users/ralphchristianeclipse/followers","following_url":"https://api.github.com/users/ralphchristianeclipse/following{/other_user}","gists_url":"https://api.github.com/users/ralphchristianeclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphchristianeclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphchristianeclipse/subscriptions","organizations_url":"https://api.github.com/users/ralphchristianeclipse/orgs","repos_url":"https://api.github.com/users/ralphchristianeclipse/repos","events_url":"https://api.github.com/users/ralphchristianeclipse/events{/privacy}","received_events_url":"https://api.github.com/users/ralphchristianeclipse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-03T18:23:00Z","updated_at":"2017-08-03T18:23:00Z","closed_at":null,"body":"The problem is when publishing a value it will return null on the subscribe method\r\n\r\n```javascript\r\nexport const subscriptions = model => ({\r\n    [model]: {\r\n        resolve(payload) {\r\n            console.log({...payload[model]})\r\n            return {...payload[model]}  \r\n        },\r\n        subscribe: withFilter(() => pubsub.asyncIterator(\r\n            ['CREATED','UPDATED', 'DELETED']\r\n            .map(mutation => `${model.toUpperCase()}_${mutation}`)),\r\n            (payload,variables) => {\r\n                return payload.id === variables.id\r\n            })\r\n    }\r\n})\r\n```\r\nAnd publishing it like this\r\n```javascript\r\n    [`update${model}`]: async(_, { id, ...args }, { models }, info) => {\r\n        let result = await models[model].findById(id)\r\n        await result.update(args)\r\n        pubsub.publish(`${model.toUpperCase()}_UPDATED`, {\r\n            [model]: args\r\n        })\r\n        \r\n        return result\r\n    },\r\n```\r\nthis is what i get received from the Subscription resolve\r\n```bash\r\n[nodemon] starting `babel-node src`\r\nServer started at 0.0.0.0:8080\r\nexpress deprecated req.host: Use req.hostname instead src/server.js:97:88\r\n{ name: 'testerssas',\r\n  description: 'test',\r\n  slug: 'testerssas',\r\n  fee: 0 }\r\nPOST /graphql 200 59.101 ms - -\r\n```\r\n\r\nand getting this error\r\n\r\n![image](https://user-images.githubusercontent.com/25447231/28936824-7b6e8640-78bb-11e7-9182-ddf8a7b7a007.png)\r\n\r\nNoticed that [object Object] is an error\r\n"}}
{"actor":{"display_login":"ralphchristianeclipse"}}