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

How to use the lib with the Apollo server v4? #219

Open
sokyrynskyi opened this issue Aug 2, 2023 · 3 comments
Open

How to use the lib with the Apollo server v4? #219

sokyrynskyi opened this issue Aug 2, 2023 · 3 comments

Comments

@sokyrynskyi
Copy link

Current examples for integration with apollo-server are provided for Apollo server v3.
For integration with the v3 the executor constructor option is used.

However in Apollo v4, there is no longer an executor constructor option.

The docs suggests passing the executor via the gateway constructor option, however this option is supposed to be used for federated solutions, which is not always the case.

Is there any recommended/tested way to integrate graphql-jit with the Apollo server v4? Probably via some Apollo plugin?

@oporkka
Copy link
Member

oporkka commented Aug 9, 2023

Thank you for bringing the issue to our attention. Unfortunately we maintainers are not aware of the changes and do not use GraphQL-JIT with Apollo server. We will not have the required time to look into this at the moment, but we would be happy to get community contribution to resolve this.

@abenhamdine
Copy link

@sokyrynskyi did you try using gateway as stated by the doc ?

like this :

new ApolloServer({
  gateway: {
    async load() {
      return { executor };
    },
    onSchemaLoadOrUpdate() {
      return () => {};
    },
    async stop() {},
  },
});

@sokyrynskyi
Copy link
Author

@abenhamdine the example in the doc is not complete, there is 1 more trick needed to set a schema for non-federated case (comment, example).
However to me it looks like a hacky workaround, from the doc it's clear that gateway is supposed to be used for federated solutions.

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

3 participants