nuwave / nuwave/lighthouse

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

Open
#2,482 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Federation/Resolvers/Entities.php at BatchEntityResolver->_invoke() and EntityResolver->_invoke(), where the issue reports that only representations are passed. Compare the entity resolver arguments described in the linked Apollo documentation and inspect the surrounding resolver flow. Done means federated entity resolvers receive the requested context and resolve-info arguments alongside representations, with coverage for both resolver paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.