lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Provide `GraphQLContext` and `ResolveInfo` in Federated Entity Resolvers

Open Maxwell2022 opened this issue 1 year ago • 1 comments

Firstly just wanted to acknowledge the great work that was done recently to push for Federation 2 support and Federated tracing! 🙏👏

Describe the bug

It seems the GraphQLContext and the ResolveInfo are not injected in the Entity resolver for federated graphs.

Expected behavior/Solution

According to Apollo Documentation (Apollo Server), the Entity resolver should receive few arguments along side the entity representation.

image

Steps to reproduce

Lighthouse Version

latest master branch

Maxwell2022 avatar Dec 08 '23 00:12 Maxwell2022

Please refrain from calling missing features bugs or categorizing them as such. According to the Lighthouse documentation, entity resolvers only receive a single argument:

  • https://lighthouse-php.com/master/federation/reference-resolvers.html#single-entity-resolvers
  • https://lighthouse-php.com/master/federation/reference-resolvers.html#batched-entity-resolvers

This has worked fine so far, what you are asking for is an additional feature.

It seems like a reasonable addition to provide this readily available information and behave more similar to Apollo. I am open to pull requests.

spawnia avatar Dec 11 '23 09:12 spawnia