lighthouse
lighthouse copied to clipboard
Provide `GraphQLContext` and `ResolveInfo` in Federated Entity Resolvers
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.
Steps to reproduce
- Only
representationsis injected in BatchEntityResolver->_invoke() - Only
representationsis injected in EntityResolver->_invoke()
Lighthouse Version
latest master branch
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.