Forum Discussion
Unable to query GraphQL many-to-many relationships
Hi,
I'm running into some issues while trying to set up a many-to-many relationship in a GraphQL schema:
I am able to create the relationship as shown above. The xref_party_email type is a simple joining table, containing only the foreign key columns. As such, Fabric creates two many-to-many relationships:
However, when I try to traverse the relationship as part of a query, I recieve the following error message:
Not entirely sure what's going on - if I create this as two separate one-to-many relationships, then the query works just fine.
Not sure if I'm missing something really obvious here?
Hi patto_uon,
This behavior is caused by a current limitation in Fabric’s GraphQL layer, not an issue with your data model. While Fabric lets you visually set up a many-to-many relationship using a pure junction table, the GraphQL runtime can’t always resolve these implicit M2M paths during queries. Because your xref_party_email table only has foreign keys and no extra fields, it isn’t treated as a concrete entity in traversal, which leads to the “destination cannot be found” error. Modeling the structure as two explicit one-to-many relationships ensures each step is backed by a real table and foreign key, allowing GraphQL to resolve the path. Until Fabric GraphQL fully supports traversing auto-generated many-to-many relationships, it’s best to treat the junction table as a first-class entity and query through it (Party - xref_party_email - Email) instead of using the implicit M2M abstraction.
Thank you.
3 Replies
- v-sgandrathi
Community Support
Hi patto_uon,
This behavior is caused by a current limitation in Fabric’s GraphQL layer, not an issue with your data model. While Fabric lets you visually set up a many-to-many relationship using a pure junction table, the GraphQL runtime can’t always resolve these implicit M2M paths during queries. Because your xref_party_email table only has foreign keys and no extra fields, it isn’t treated as a concrete entity in traversal, which leads to the “destination cannot be found” error. Modeling the structure as two explicit one-to-many relationships ensures each step is backed by a real table and foreign key, allowing GraphQL to resolve the path. Until Fabric GraphQL fully supports traversing auto-generated many-to-many relationships, it’s best to treat the junction table as a first-class entity and query through it (Party - xref_party_email - Email) instead of using the implicit M2M abstraction.
Thank you.
- patto_uonFrequent Visitor
Hi v-sgandrathi, thanks very much for the quick response.
Just to confirm, is this the same issue?
https://support.fabric.microsoft.com/known-issues/?active=true&fixed=true&sort=published&product=Data%2520Engineering&issueId=1700If so, I would think that the documentation for creating GraphQL relationships should explicitly call out this limitation until it is resolved, as it contradicts the actual functionality available:
Manage relationships in Fabric API for GraphQL - Microsoft Fabric | Microsoft Learn - v-sgandrathi
Community Support
Hi patto_uon,
Yes, this is the same underlying issue. The known issue you referenced is about a limitation in Fabric’s GraphQL runtime when resolving auto-generated many-to-many relationships that use a pure junction table (one with only foreign keys and no extra attributes).
Currently, while the modeling experience lets you define an implicit M2M relationship, the GraphQL layer can’t always resolve that path during queries. That’s why you encounter the “destination cannot be found” error, whereas setting up two explicit one-to-many relationships works correctly.
Your point about the documentation is valid. The Manage relationships in Fabric API for GraphQL article describes M2M relationships as supported, but it doesn’t mention this runtime limitation. This can be misleading because the UI suggests full support, but the best practice for now is to treat the junction table as a main entity and traverse it directly (Party - xref_party_email - Email).
Thank you for pointing out this gap. Feedback like yours helps improve the documentation to better reflect the current behavior until full M2M support is available in the GraphQL runtime.
Thank you.