How can I achieve a shared context across a federated graph?
- Linguagem predominante
- Go
- Estrelas
- 10.8k
- Forks
- 1.3k
- Merge médio
- 2d 36min
- PRs com merge (30d)
- 26
Descrição
I'm looking for some way to pass context about what 1 microservice resolved to the following microservices involved in serving the request.
```
Thing { # resolved by microservice 1
id
name
items {
id
name
stuff { # resolved by microservice 2
id
foo {
bar { # resolved by microservice 3
...barFields
}
}
}
}
}
```
In order for microservice 2 to resolve the fields of `stuff`, `items'` `stuff` field resolver must return something like
`{ id: item.stuffId}`.
In order for microservice 3 to resolve the fields of `bar`, `foo's` `bar` field resolver must return something like
`{ id: stuff.barId}`.
that all works just fine, but what if i wanted `barFields` in microservice 3 to have context about the `item` back in microservice 1?
From what I've observed so far, returning other fields besides `id` or `__typename` will be dropped when the request continues to the next microservice
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.