Vok
Vok

Reputation: 467

Does Apollo Server work with GraphQL Tools stitchSchemas?

According to Apollo docs

However, I've just noticed I can't directly import stitchSchemas from apollo-server (I've been using it from @graphql-tools/stitch), and am hours deep in problems that aren't making sense.

Does Apollo work with stitchSchemas or not?

Upvotes: 0

Views: 488

Answers (1)

Daniel Rearden
Daniel Rearden

Reputation: 84697

Yes, you can use stitchSchemas with Apollo Server, but you should install the latest version of graphql-tools and import stitchSchemas from graphql-tools instead of apollo-server.

You can use the latest version of graphql-tools to build a GraphQLSchema object, whether through stitchSchemas, makeExecutableSchema or some other utility. You can then initialize ApolloServer using this schema:

const server = new ApolloServer({ schema })

Upvotes: 1

Related Questions