apollographql / apollographql/apollo-tooling
Allow Multiple Schemas
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
I looked through a bunch of other issues and there doesn't seem to be a solution for this. I am building a React Typescript website that ingests two different graphql servers. I would like to generate types for both automatically. It would be nice if we could specify multiple different services in the `apollo.config.js` file and have the codegen tool automatically figure out which query belongs to which endpoint. In the case of a conflict, we should be able to specify which name to go with and generate types for that.
My current solution is to create two different `queries` folders, two configs, and generate all of the types in their specific folder. However, I would much prefer co-locating the queries inside the file they are being used in.
Contributor guide
Research direction
Start with the apollo.config.js configuration and the codegen tool's handling of the separate configurations described in the issue. Define how multiple services, query-to-endpoint selection, and naming conflicts should work, then verify that co-located queries can generate types for both GraphQL servers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, react, typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100