You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using 2 different schemes for 2 different services in GraphQL.
We have provided 2 different codegen scripts to generate both schemes Models, since while using 2 different schemes within the same codegen-config.json file was mistakenly trying to generate queries from one scheme using the other scheme.
Each configuration file uses a different namespace.
Problem
Files generated like Query.graphql.swift, SchemeMetadata.graphql.swift, SchemeConfiguration.graphql.swift are duplicated for each scheme, so it needs manual changes to remove redeclaration of files in order to make it possible to compile.
Possible Suggestion
Add a parameter on codegen-config.json where we can set a value of merge equal classes or files
{
...
"options":
{
"mergeFiles": true
}
...
}
More context
We are using Apollo inside a Package outside of our main project target in order to avoid the need of adding files manually to the project target
We have provided 2 different codegen scripts to generate both schemes Models, since while using 2 different schemes within the same codegen-config.json file was mistakenly trying to generate queries from one scheme using the other scheme.
This is not a bug but part of the design. Apollo iOS, both the client and the code generator, are designed to be used for a single schema only. It is possible to have more than one schema generated and used in your project but they are separate packages, cannot share schema metadata and each will require their own Apollo Client instance.
Unfortunately merging multiple schemas into a single schema is not a feature we plan on supporting.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Summary
We're using 2 different schemes for 2 different services in GraphQL.
We have provided 2 different codegen scripts to generate both schemes Models, since while using 2 different schemes within the same codegen-config.json file was mistakenly trying to generate queries from one scheme using the other scheme.
Each configuration file uses a different namespace.
Problem
Possible Suggestion
More context
We are using Apollo inside a Package outside of our main project target in order to avoid the need of adding files manually to the project target
Version
1.8.0
Steps to reproduce the behavior
Config Example
Config File 1
Config File 2
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: