Skip to content
New issue

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

Subscription Implementation with Prisma Binding #432

Open
redeguzman-gbf opened this issue Aug 27, 2019 · 0 comments
Open

Subscription Implementation with Prisma Binding #432

redeguzman-gbf opened this issue Aug 27, 2019 · 0 comments

Comments

@redeguzman-gbf
Copy link

Is there clear documentation on how to implement subscriptions with prisma-binding? I’m using prisma 1.34 and prisma-binding 2.3.15.

At the moment, I have a subscription that looks like this:

type Subscription {
  table: Table
}

and a resolver that looks like this:

Subscription: {
    table: {
      subscribe: async (parent, args, ctx, info) => {
        return ctx.db.subscription.table({}, info);
      },
      resolve: payload => {
        return payload
      }
    }
  }

and I get this error:

{
  "errors": [
    {
      "message": "Unexpected error value: [{ message: \"Anonymous Subscription must select only one top level field.\" }]",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "table"
      ]
    }
  ]
}

I can’t find any documentation that clearly tackles this. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant