graphql-transform-federation icon indicating copy to clipboard operation
graphql-transform-federation copied to clipboard

allow hide fields and types

Open mac2000 opened this issue 5 years ago • 2 comments
trafficstars

According to #1 and my founding we gonna need to be able to hide fields exactly inside this transform not before (wont be able to delegate) not after (gateway wont work)

What have I done in this PR:

  1. Added hidden to both FederationFieldConfig and FederationObjectConfig
  2. Added null as possible return type to visitor - according to spec if we return null node will be removed
  3. Simple if statements to check whether current node is unwanted which return null

Test and readme also included

Hope to see it somewhere in near future in your library it will help us move further and connect everything into one beautiful graph without this hacky ways to remove unwanted fields

BR Alex

mac2000 avatar Apr 27 '20 10:04 mac2000

Accidentally did push packages upgrade, everything still working (tests and example server)

While upgrading added missed concurentlly package

If you want I can try to revert it and make separate PR just for versions upgrade, seems like it might solve many issues like #5

mac2000 avatar Nov 15 '20 12:11 mac2000

@0xR if it fixes https://github.com/0xR/graphql-transform-federation/issues/5 then can we merge this one?

VasiliKubarka avatar Nov 25 '20 15:11 VasiliKubarka