Question about generateApolloMetadata support in Apollo iOS for multi-module projects

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:

  1. Is there currently any support in Apollo iOS similar to generateApolloMetadata for enabling fragment sharing across modules?

  2. If not, is this feature planned for a future release?

  3. 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!

Hi - we have a section of the Operation Models Configuration documentation specifically for Sharing fragments across modules. You’ll need to place the common fragments into that module that can then be shared by importing it where needed.