apollographql / apollographql/federation
join__field not added to query fields when composeServices is called for one service
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 727
- Forks
- 276
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 1
Description
Issue Description
The join__field directive is absent from the supergraph if only one subgraph is passed in to composeServices.
This caused an issue for me when onboarding teams to a new registry because initially, when only one schema was onboard, all query fields disappeared when generating a stitched schema via getStitchedSchemaFromSupergraphSdl from @graphql-tools/federation.
The expectation is that join__field will always be added to fields
Link to Reproduction
Reproduction Steps
Call composeServices with a single subgraph
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at composeServices, then follow the generated supergraph into getStitchedSchemaFromSupergraphSdl; use the linked CodeSandbox reproduction to observe the single-subgraph case. Done means a one-service composition includes join__field on fields and the stitched schema no longer loses query fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100