Replies: 2 comments
-
Hi @vrm535, relationship configuration is not supported for CosmosDB as the backing database: https://learn.microsoft.com/azure/data-api-builder/feature-availability#graphql-relationship-navigation @sajeetharan Do we need a backlog feature request opened for this or are you already tracking one? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@seantleonard Yes it's being tracked here #1569 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I just started PoC with Data API builder for Cosmos DB backend. With one container, I could able to configure things for graphql. When I try to setup relationship between multiple containers, it's throwing me error :
Could not infer database object for source entity: workspaces in relationship: assets. Check if the entity: workspaces is correctly defined in the config.
Error: Could not infer database object for target entity: assets in relationship: assets. Check if the entity: assets is correctly defined in the config.
My usecase:
I have two containers workspace and assets. Workspace is the top level entity and it will have many Assets.
Workspace container will have id, name, email, group fields. Assets will have id, workspaceId, type
I am creating the entities and it's relationship as below.
"entities": {
"workspaces": {
"source": {
"type": "table",
"object": "workspaces"
},
"relationships": {
"assets": {
"target.entity": "assets",
"cardinality": "many",
"source.fields": [
"id"
],
"target.fields": [
"workspaceId"
]
}
},
"graphql": {
"enabled": true,
"type": {
"singular": "workspaces",
"plural": "workspaces"
}
},
"rest": {
"enabled": false
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": ""
}
]
}
]
},
"assets": {
"source": {
"type": "table",
"object": "assets"
},
"graphql": {
"enabled": true,
"type": {
"singular": "assets",
"plural": "assets"
}
},
"rest": {
"enabled": false
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": ""
}
]
}
]
}
}
Here is my graphql schema
type workspaces @model {
id: ID!
owner: String!
email: String
adGroup: String!
}
type assets @model {
id: ID!
workspaceId: String!
assetType: String
githubRepo: String!
}
Can someone help me where is it going wrong.
Beta Was this translation helpful? Give feedback.
All reactions