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(services/gql-subscription): allow custom execute() and subscribe() for other plugin systems #2156

Conversation

charlypoly
Copy link
Contributor

Follow-up on #2145:

Update the GqlSubscriptionServiceOptions configuration to allow passing custom execute() and subscribe() function.
This change is required to support GraphQL Server plugin systems such as Envelop and to allow support GraphQL Yoga.

@charlypoly charlypoly mentioned this pull request Apr 27, 2022
@charlypoly
Copy link
Contributor Author

Hi @kamilmysliwiec,

Do you know who I could ping to review this short PR?
This is "blocking" us from releasing the GraphQL Yoga driver.

Thank you!

@kamilmysliwiec kamilmysliwiec merged commit a6c68fc into nestjs:master May 5, 2022
@kamilmysliwiec
Copy link
Member

LGTM

@kamilkisiela kamilkisiela deleted the feat/gql-subscriptions-envelop-support branch May 5, 2022 08:05
@sschneider-ihre-pvs
Copy link

@charlypoly does this only work for subscriptions or is there a way to access the executor to attach envelop to the server?

@charlypoly
Copy link
Contributor Author

@sschneider-ihre-pvs I guess the only way to achieve such a thing would be to create a Nestjs GraphQL driver.

However, please note that we will soon release the GraphQL Yoga Nestjs GraphQL driver which is built on top of Envelop, allowing you to pass plugins in the driver config.

@sschneider-ihre-pvs
Copy link

But I don't have yoga, I use the apollofederationdriver

@charlypoly
Copy link
Contributor Author

@sschneider-ihre-pvs

But I don't have yoga, I use the apollofederationdriver

Looking at the Apollo driver code, I guess it could be possible to pass the executor option as showcased here: https://github.com/dotansimha/envelop/blob/main/examples/apollo-server/index.ts

@sschneider-ihre-pvs
Copy link

ok, but how do I get the schema from within the driver?

@charlypoly
Copy link
Contributor Author

ok, but how do I get the schema from within the driver?

I am not part of the NestJS team, just an outside contributor 🙂

Have you checked the full documentation https://docs.nestjs.com/graphql/quick-start?
This subjects seems a bit out of scope with this PR, maybe a more efficient way would be to open a dedicated issue for it where the NestJS core team could answer

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

Successfully merging this pull request may close these issues.

None yet

3 participants