Hi team,
We’re working on an iOS project with a multi-module architecture where several feature modules share core GraphQL fragments defined in a common module.
In Apollo Android/Kotlin, the generateApolloMetadata option helps enable fragment sharing across modules by generating metadata that downstream modules can use during code generation.
While looking for a similar approach in Apollo iOS, we saw mentions in discussions that metadata generation might be supported in the future, but we couldn’t find this option in the current iOS codegen configuration.
Our goal is to:
-
Define shared fragments in a core module
-
Allow feature modules to reuse those fragments
-
Avoid duplicating fragment definitions across modules
-
Keep GraphQL codegen working correctly in a multi-module setup
Could you please clarify:
-
Is there currently any support in Apollo iOS similar to
generateApolloMetadatafor enabling fragment sharing across modules? -
If not, is this feature planned for a future release?
-
What is the recommended approach today for sharing GraphQL fragments between modules in a multi-module iOS project?
For context:
-
Apollo iOS version: 1.25.3
-
Code generation: Apollo CLI / codegen configuration
-
Architecture: multiple Swift modules with a shared GraphQL core module
Thanks in advance for any guidance!