apollographql / apollographql/apollo-tooling

Allow Multiple Schemas

Open
#1,979 0 comments 3 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.