You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm seeing an issue when batching interface types. I have a query that returns an interface, that resolves to a few different types. Then, on each of those types, I query an interface field. In this case, it seems that the resolutions are batched by type. I wonder if this is intentional, if there's a known way to override it, or work around it?
For example, in the following query, the lookup query returns an array of MyInterface types, that all have a name property. However, the object with id abc123 is of TypeA and abc456 of TypeB (both implementing MyInterface).
# Write your query or mutation here
{
lookup(
ids: [
"abc123"
"abc456"
]
) {
meta {
name
}
}
}
In this case, the batch resolver creates two batches, and I would like it to create one. E.g. is it possible to group based on interface instead of concrete type?
The text was updated successfully, but these errors were encountered:
All resolvers that are run before the next event-loop run are batched.
All resolvers that are run with the same query AST node are batched.
I doubt it’s the second heuristic that’s broken here. Is there any reason why your two interfaces would resolve on different event-loop ticks? Can you make a minimal viable reproducing case?
Hi, I'm seeing an issue when batching interface types. I have a query that returns an interface, that resolves to a few different types. Then, on each of those types, I query an interface field. In this case, it seems that the resolutions are batched by type. I wonder if this is intentional, if there's a known way to override it, or work around it?
For example, in the following query, the
lookup
query returns an array ofMyInterface
types, that all have aname
property. However, the object with idabc123
is ofTypeA
andabc456
ofTypeB
(both implementingMyInterface
).In this case, the batch resolver creates two batches, and I would like it to create one. E.g. is it possible to group based on interface instead of concrete type?
The text was updated successfully, but these errors were encountered: