Skip to content

[Bug]: GraphQL queries fail with many-to-many relationships on custom schema #3071

@Alekhya-Polavarapu

Description

@Alekhya-Polavarapu

What happened?

GraphQL queries that involve many-to-many relationships fail unless an identical bridging view exists in the dbo schema.
This has been reported but a customer when accessing the API for GraphQL endpoint in fabric.

Example repro:
create schema mySchema;
books -> id, name;
authours -> id, title
books_authors -> book_id, author_id // linking entity

attach these to GraphQL API and configure M:N relation with linking entity as shown

linkingObject: "mySchema.books_authors"
linkingSourceFields: ["book_id"]
linkingTargetFields: ["author_id"]
sourceFields: ["id"]
targetFields: ["id"]
targetObject: "mySchema.authors"

And run a sample query something like this
query{ authors { items { id books { items { title } } } } }

which throws this sql error, that basically means the underlying object is not found.
{
"SqlNumber": "208",
"Class": "16",
"SqlState": "1"
}

However, when a linking entity is created under dbo schema, and without even adding that to graphql schema, it works.
So, probably the T-SQL query for linking entity is still referring to dbo.<table_name> but not the custom schema.

Version

latest

What database are you using?

Azure SQL

What hosting model are you using?

No response

Which API approach are you accessing DAB through?

No response

Relevant log output


Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfabricrequired by API for GraphQL on Microsoft Fabrictriageissues to be triaged

Type

No type

Projects

Status

Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions