apollo-tooling icon indicating copy to clipboard operation
apollo-tooling copied to clipboard

apollo client:codegen --mergeInFieldsFromFragmentSpreads option does nothing

Open FritsvanCampen opened this issue 4 years ago • 2 comments

mergeInFieldsFromFragmentSpreads is on by default. The command line option allows you to only turn it on. There is no way turn it off.

mergeInFieldsFromFragmentSpreads is implemented as an oclif boolean flag so alternatives like apollo client:codegen --mergeInFieldsFromFragmentSpreads=false don't work.

There is an older issue: https://github.com/apollographql/apollo-tooling/issues/537 where the meaning of the flag was inverted but this was not done everywhere.

Potentially the fix is as simple as changing this line: https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/codegen.ts#L235 From flags.mergeInFieldsFromFragmentSpreads to !!flags.mergeInFieldsFromFragmentSpreads

It might also be necessary to update the docs.

FritsvanCampen avatar Sep 16 '21 14:09 FritsvanCampen

The issue still exists

kirillmarkelov avatar Apr 15 '22 15:04 kirillmarkelov

Any update on this?

Kienan6 avatar May 19 '22 21:05 Kienan6