Skip to content

False positive fragment Foo is unused in multi-module setup #6880

@lwasyl

Description

@lwasyl

Version

5.0.0-alpha.5-20260208

Summary

With multi-module setup, we get tons of warnings about unused fragments:

// in base network module with the schema:
> Task :modules:network:graphql:generateWhatnotApolloIrOperations
w: /.../Foo1.graphql: (1, 1): Apollo: Fragment 'Foo1' is not used
w: /.../Foo2.graphql: (1, 1): Apollo: Fragment 'Foo2' is not used
w: /.../Foo3.graphql: (1, 1): Apollo: Fragment 'Foo3' is not used
w: /.../Foo4.graphql: (1, 1): Apollo: Fragment 'Foo4' is not used
w: /.../Foo5.graphql: (1, 1): Apollo: Fragment 'Foo5' is not used

> Task :<feature module>:generateWhatnotApolloIrOperations
w: null: (1, 1): Apollo: Fragment 'Foo1' is not used
w: null: (1, 1): Apollo: Fragment 'Foo2' is not used
w: null: (1, 1): Apollo: Fragment 'Foo3' is not used
w: null: (1, 1): Apollo: Fragment 'Foo4' is not used
w: null: (1, 1): Apollo: Fragment 'Foo5' is not used
w: null: (1, 1): Apollo: Fragment 'Foo6' is not used


> Task :<feature module 2>:generateWhatnotApolloIrOperations
w: null: (1, 1): Apollo: Fragment 'Foo1' is not used
w: null: (1, 1): Apollo: Fragment 'Foo2' is not used
w: null: (1, 1): Apollo: Fragment 'Foo3' is not used
w: null: (1, 1): Apollo: Fragment 'Foo4' is not used
w: null: (1, 1): Apollo: Fragment 'Foo5' is not used
w: null: (1, 1): Apollo: Fragment 'Foo6' is not used

... // same output for all feature modules

All feature modules depend on the core module with the schema using

service.dependsOn(project(":modules:network:graphql"), true)

The fragments in question are in fact unused in the core schema module, and most of the feature modules don't use them either. However, they are used somewhere, so they shouldn't be marked as unused neither in the core module or the feature ones

I suppose possibly related to #6497?

Steps to reproduce the behavior

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions