apollographql / apollographql/federation
How to @override a field from another subgraph using original value from that subgraph
- Dominant language
- TypeScript
- Stars
- 725
- Forks
- 276
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 1
Description
My case is: I have two subgraphs
`products` with type `Product`
```graphql
type Product @key("id") {
id ID!
name: String!
}
```
and `translations` where I am trying to override `name` field
```graphql
type Product @key("id") {
id ID! @external
name: String! @requires("name") @override("products")
}
```
The problem is - I do not know how to tell Gateway/Router that I need a field `name` from `products` subgraph and then I will use it in `translations` subgraph to generate a new value based on original value.
For example: if `name` field from `products` subgraph is `IPhone`, I need to modify it for example like: `IPhone (EN)`.
Is it possible to achieve what I am trying to do ?
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by reviewing how @requires and @override are handled between the products and translations subgraphs; done means an agreed supported approach or a clearly documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100