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

feat: support graphql subscriptions v3 #636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

williamrijksen
Copy link

No description provided.

@kasir-barati
Copy link

When this will be rolled out?

@kasir-barati
Copy link

We already have changed the docs in NestJS: nestjs/docs.nestjs.com#3150 (comment)

Any idea?

@kasir-barati
Copy link

kasir-barati commented Nov 26, 2024

BTW I also realized that right now when I use this code my type won't match anymore with Apollo server's auto geenrated code. Does this PR covers this topic as well?

Code:

import { RedisPubSub } from 'graphql-redis-subscriptions';
import type { Resolvers } from '../../__generated__/resolvers-types';

const redisPubSub = new RedisPubSub();

  Subscription: {
    top: {
      subscribe(parent, args, context, info) {
        return redisPubSub.asyncIterator([
          'server-statistics-changed',
        ]);
      },
    }
  }
}

Error:

Type '(parent: {}, args: {}, context: Context, info: GraphQLResolveInfo) => AsyncIterator<unknown, any, any>' is not assignable to type 'SubscriptionSubscribeFn<any, {}, Context, {}>'.
  Type 'AsyncIterator<unknown, any, any>' is not assignable to type 'AsyncIterable<any> | Promise<AsyncIterable<any>>'.ts(2322)

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

Successfully merging this pull request may close these issues.

2 participants