question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merge schemas and resolvers

See original GitHub issue

I want to separate my schemas and resolvers to separated files as it’s kinda big right now in one single file.

I found a library called merge-graphql-schemas but I think that it’s redundant with Apollo Server 2 and graphql-tools, the thing is that Apollo Server 2 does already what graphql-yoga does and I don’t need to call makeExecutableSchema in the version 1 as I needed before as it’s now wrapped inside the new ApolloServer (see here so now I’m wondering, how can I use graphql-tools and mergeSchema with Apollo Server 2? I don’t even know if this approach, I guess called schema stitching is only for remote schemas or it’s suited for local ones as well, like having an schema for user, another one for posts, and so on…

How can I accomplish this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
justinmwarnercommented, Oct 25, 2019

@martijnwalraven where are these experimental modules?

2reactions
havinhthaicommented, Apr 2, 2019

I use graphql-import to merge schemas and graphql-merge-resolvers to merge my resolvers. Hope can help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schema Merging – GraphQL Tools
Originally implemented in graphql-modules. This tool merges GraphQL type definitions and schema. It aims to merge all possible types, interfaces ...
Read more >
Merge Resolvers with GraphQL Tools - Episode #23
Load and merge GraphQL resolvers from multiple files using GraphQL Tools. ... const resolvers = mergeResolvers(resolverFiles); const schema ...
Read more >
How to merge the typedefs and resolvers on building the ...
Something like this I am trying to do schema: ... import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge'; const typeDefs ...
Read more >
Merging executable & non-executable schemas
Another option when merging schemas is to take an existing executable schema and add type definitions to it. Then, when merging the schemas...
Read more >
Merge GraphQL schemas & resolvers in modules - gists · GitHub
Merge GraphQL schemas & resolvers in modules. GitHub Gist: instantly share code, notes, and snippets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found