federation icon indicating copy to clipboard operation
federation copied to clipboard

Fix naming/lookup of core schema directives in supergraph

Open clenfest opened this issue 2 years ago • 0 comments

Issue Description

When implementing @authenticated and @requireScopes, @trevor-scheer noticed that there was an issue if they were both in the same coreSpec auth. There seems to be two main issues.

  1. The name it looks for in mergeAppliedDirective is inconsistent with how it's named in the supergraph. The name field when trying to merge is @authenticated, but in the supergraph it gets named as either @auth_authenticated or @authenticated__authenticated depending on the name parameter on the FeatureUrl. Counterintuitively the prefix seems to be the opposite of the name on the FeatureUrl, so there is something broken with how things are named in addition to the lookup being inconsistent.

  2. If we try to rename directives via using as, The name is seemingly more incorrect in the supergraph. If we import @authenticated as @myauth, then the name we get in the supergraph is @myauth__authenticated, when I think it should be @auth__myauth.

Link to Reproduction

n/a

Reproduction Steps

No response

clenfest avatar Jul 13 '23 15:07 clenfest