Anyone successfully gotten subscriptions to work w...
# orm-help
t
Anyone successfully gotten subscriptions to work with Prisma 1? I’m setting them up and I’m almost all the way there, but I’m getting this error back while listening to one in the Playground:
Copy code
{
  "errors": [
    {
      "message": "Cannot read property 'body' of undefined",
      "locations": [
        {
          "line": 149,
          "column": 3
        }
      ],
      "path": [
        "syncState"
      ]
    }
  ],
  "data": null
}
This is how my
syncState
subscription is set up:
Copy code
import { subscriptionField } from 'nexus';
import { Context } from '../../dbTypes';

export const syncStateSubscription = subscriptionField('syncState', {
	type: 'SyncStateSubscriptionPayload',
	subscribe(root, args, ctx: Context) {
		return ctx.prisma.$subscribe.syncState() as any;
	},
	resolve(payload) {
		return payload;
	},
});