Apollo server 4 and subgraphs #2621
Unanswered
praneetheus
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey You're right — For import { buildSubgraphSchema } from '@apollo/subgraph';
import { ApolloServer } from '@apollo/server';
const schema = buildSubgraphSchema({
typeDefs: application.typeDefs,
resolvers: application.resolvers,
});
const server = new ApolloServer({ schema });
Hope this helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My project is using Apollo server 4 and graphql-modules 2.4.0. I am using the workaround described here #2270 to get the graphql-modules working.
I want to implement a subgraph and I am following the documentation here, https://www.apollographql.com/docs/apollo-server/using-federation/apollo-subgraph-setup, but I can't pass both
schema
andgateway
to theApolloServer
constructor.The only workaround I found is to use the deprecated
createSchemaForApollo
, with this, modules work with subgraph, but I rather not rely on deprecated functions if possible.Has anyone encountered this issue? Any potential solutions for this?
Beta Was this translation helpful? Give feedback.
All reactions