Apollo query level routing #2542
Replies: 1 comment
-
|
as a quick answer, the subgraph plugins can edit the subgraph request URL, so it should be possible to dispatch to different URLs depending on a condition, like a header in the client request. Separating per fields in enum join__Graph {
FOO @join__graph(name: "accounts" url: "http://foo.com")
FOO3 @join__graph(name: "inventory" url: "http://www3.foo.com")
}
type Query {
x: Value @join__field(graph: FOO)
y: Value @join__field(graph: FOO3)
}Then |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We would like to evaluate if there are constructs in the GQL schema of the subgraph to achieve the following
Let me provide a few concrete examples to enumerate it betterSuppose we have subgraph foo with queries x,y,z and foo can have deployment foo-1, foo-2, foo-3 with symmetric codebases
subgraph foo {
type query {
x(x1, x2...)
y(y1, y2..)
z(z1, z2..)
}}
Conditions
As we understand, the schema update to the registry captures the routing URL at a subgraph level, which means the following options were available
Please do suggest is there alternatives and better clean solves
Beta Was this translation helpful? Give feedback.
All reactions