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
I would expect this to compose ok, because the gateway should understand that all PhysicalProduct objects are also Product objects, so resolving reviews on them should be possible via the reviews subgraph. However, attempting to compose the above results in an error:
Interface field "Product.reviews" is declared in but type "PhysicalProduct", which implements "Product" only in subgraph "products" does not have field "reviews".
This can be worked around by instead declaring the following in the reviews subgraph:
But this solution is pretty undesirable, since it means that we can't actually separate concerns between the two subgraphs (as the reviews subgraph needs to be aware of all interfaces extending Product in the products subgraph instead of just the Product interface).
The text was updated successfully, but these errors were encountered:
bluepichu
changed the title
Unable to add an interface extending an entity interface
Unable to add an interface extending an entity interface without breaking dependent subgraphs
Feb 14, 2024
Issue Description
Consider these subgraphs:
I would expect this to compose ok, because the gateway should understand that all
PhysicalProduct
objects are alsoProduct
objects, so resolvingreviews
on them should be possible via the reviews subgraph. However, attempting to compose the above results in an error:This can be worked around by instead declaring the following in the reviews subgraph:
But this solution is pretty undesirable, since it means that we can't actually separate concerns between the two subgraphs (as the reviews subgraph needs to be aware of all interfaces extending
Product
in the products subgraph instead of just theProduct
interface).Link to Reproduction
https://codesandbox.io/p/devbox/stoic-jennings-dmtcpt?workspaceId=f349a0f5-d280-4992-b1d5-8f95a3bc8dda
The text was updated successfully, but these errors were encountered: