graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

Prune should remove subfields of @hidden fields

Open chargePanelAndreas opened this issue 1 year ago • 1 comments
trafficstars

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • [ ] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • [ ] 2. A failing test has been provided
  • [ x] 3. A local solution has been provided
  • [ x] 4. A pull request is pending review

Describe the bug

When using the Prune utility together with @graphql-mesh/compose-cli any fields that are removed from the schema using the Filter transform is marked with directive @hidden. I noticed that even if the fields did not show up in the resulting introspection, all of the associated (unused) types still appeared in the schema.

To Reproduce Steps to reproduce the behavior:

Mark a field with @hidden. It does nothing when pruning.

Expected behavior

I would like fields that are excluded in the introspection to not have remaining unused types.

Environment:

  • @graphql-tools/utils: 10.5.5

chargePanelAndreas avatar Oct 17 '24 08:10 chargePanelAndreas