nuwave / lighthouse

A framework for serving GraphQL from Laravel
https://lighthouse-php.com
MIT License
3.36k stars 438 forks source link

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

Open Maxwell2022 opened 10 months ago

Maxwell2022 commented 10 months ago

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

spawnia commented 9 months ago

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

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.