Hey all, so I’m trying to get prisma 1 working wit...
# orm-help
p
Hey all, so I’m trying to get prisma 1 working with subscriptions. I followed the example and it looks like this.
Copy code
const userUpdates = {
  subscribe: async (parent, { id }, context, info) => {
    // Function: userUpdates, a resolver function that subscribes to
    // any changes made to a user.
    //
    // Parameter(s):
    //
    //   parent, args, context, info - default prisma parameters
    //   args is an object containing the user Id
    //
    // Return Value(s):
    //
    //   a subscription
     // node: { id_contains: id },

    return context.prisma.$subscribe.user({ node: { id: id }, mutation_in: ["UPDATED"] }).node();
  },
  resolve: (payload) => {
    //returning payload
    console.log("hi", "two")
    return payload;
  }
}
[8:59 PM] However I’m getting this error when I update a user (edited) 
Copy code
[8:59 PM] {
  "errors": [
    {
      "message": "Cannot read property 'get' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "userUpdates"
      ]
    }
  ],
  "data": null
}
[9:00 PM] I’m using prisma-client-library 1.34.10 [9:01 PM] I’m aware you can use PubSub from graphql-yoga to implement subscriptions so should I go that route or does anyone know a fix to this?
s
if you're using nexus in prisma 1 then make sure you've followed this instruction: https://github.com/graphql-nexus/nexus-plugin-prisma/releases?after=v0.4.1