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

Feature Request: Export Stable Schema Generation #1640

Closed
j opened this issue Jul 16, 2021 · 3 comments
Closed

Feature Request: Export Stable Schema Generation #1640

j opened this issue Jul 16, 2021 · 3 comments

Comments

@j
Copy link

j commented Jul 16, 2021

First and foremost, switching over to Nest.js has been amazing for our company, especially utilizing @nestjs/graphql. We've come to realize the necessity to have higher throughput servers though and apollo-server has been quite a bottle netck in some cases and we can do better.

Apollo Server with Express is pretty terrible, especially with tracing enabled. Apollo Server with Fastify is 2x faster than with express. But going further, other GraphQL building blocks are emerging which provide a ton more performance wins than Apollo Server.

Reference: https://github.com/benawad/node-graphql-benchmarks

I understand Nest is coupled to express or fastify right now, so you're limited to those. i'm also not sure how much of a performance impact you'd get in the nest ecosystem if you switched to a different GraphQL execution library/server. I know you can use graphql-jit using custom executors in Express, so there's that to try.

But going beyond "performance" being the motivator. Apollo has been rubbing us the wrong way ever since they've been commercializing their product. Federation is a cool thing and glad they've implemented it, but it's slow with features and other people are making arguably better versions (GraphQL tools schema stitching is back and alive), and "Mercurius" (the superior IMO GraphQL server framework).

The best example of what I'm wanting is @Davide-Gheri's attempt at pulling in the @nestjs/graphql tools for schema generation, however it's pretty fragile (https://github.com/Davide-Gheri/nestjs-mercurius). When internal tools change and break, his library breaks. He has to lock to a specific version. Updates are a pain and hard as well.

I think in a perfect world, @nestjs/graphql would be a GraphQL schema generation library focusing on connecting Nest.js to GraphQL resolvers, and create a second @nestjs/apollo library to implement the server. Or just keep it all in @nestjs/graphql but keep apollo optional and export a schema generation module?

I just wanted to see if there was any interest with this so that people can start building better GraphQL implementations without re-inventing the wheel.

@chrislambe
Copy link

I think isolating the server-agnostic parts of the @nestjs/graphql package is a really great idea. Our company has felt somewhat hamstrung by the coupling to Apollo Server and would love to greater flexibility in choosing (or home-rolling) a server implementation.

@andreialecu
Copy link
Contributor

Apollo has been moving away some licenses from MIT recently and there are some growing concerns in the community about it.

https://www.apollographql.com/blog/announcement/moving-apollo-federation-2-to-the-elastic-license-v2/

I think it's becoming increasingly important to break the tight coupling and give users a choice about this.

Pinging @kamilmysliwiec for visibility.

@kamilmysliwiec
Copy link
Member

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

4 participants