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 does not work with extendType #594

Closed
jasonkuhrt opened this issue Oct 30, 2020 · 0 comments
Closed

Subscription does not work with extendType #594

jasonkuhrt opened this issue Oct 30, 2020 · 0 comments
Labels
scope/subscriptions type/bug Something is not working the way it should

Comments

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Oct 30, 2020

extendType does not support extending Subscription.

E.g. this does not work:

extendType({
  type: 'Subscription',
  definition(t) {
    t.boolean('truths', {
      subscribe() {
        return (async function* () {
          while (true) {
            await new Promise((res) => setTimeout(res, 1000))
            yield Math.random() > 0.5
          }
        })()
      },
      resolve(eventData) {
        return eventData
      },
    })
  },
})
@jasonkuhrt jasonkuhrt added the type/bug Something is not working the way it should label Oct 30, 2020
@jasonkuhrt jasonkuhrt added this to Next Sprint in Prisma GraphQL WG Team Nov 12, 2020
@jasonkuhrt jasonkuhrt moved this from Next Sprint to This Sprint in Prisma GraphQL WG Team Nov 25, 2020
@jasonkuhrt jasonkuhrt added scope/subscriptions needs/discussion Open-ended conversation about something (ideation, design, analysis, ...) and removed needs/discussion Open-ended conversation about something (ideation, design, analysis, ...) labels Nov 25, 2020
Prisma GraphQL WG Team automation moved this from This Sprint to Shipped Nov 30, 2020
9renpoto pushed a commit to 9renpoto/schema that referenced this issue Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/subscriptions type/bug Something is not working the way it should
Projects
Development

No branches or pull requests

1 participant