apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 467 forks source link

Code Generation In Mono Repo With Multiple Graphql APIs #2663

Closed sabovyan closed 1 year ago

sabovyan commented 1 year ago

Combine All Types In One Package.

Hi everyone ! We have a mono repo with multiple apps and packages inside of it. At the same time we have 3 endpoints that serve graphQl api. And as we have shared queries in different app we decided to create a package that will keep all our queries and their generated types. But we encountered to a problem, that exports from these auto generated types causes type issue.

Basically it is possible to resolve problem with the types that are coming from our APIs by prefix or suffix. But we still have a problem related to exporting other types like Maybe, InputMaybe or Exact.

I would like to know if there is a best practice for these cases ?