I am new to extending CogniteCore data model to further extend. How to Import CogniteCore datamodel to further extend in a new datamodel space.
How to Import CogniteCore datamodel to further extend in a new datamodel space
Best answer by Ali Tahir
Ah, the error is because you're querying `root` and `path` which reference `CogniteAsset`, but that view isn't included in your data model.
When you implement CogniteAsset in your types, you get the properties, but to actually query relationship fields in GraphQL, the referenced view needs to be explicitly part of your data model definition.
Quick fix can be - add CogniteAsset to your model:
In your data model definition, include:
```yaml
views:
- space: your_space
externalId: LiftStation
version: "1"
- space: your_space
externalId: Pump
version: "1"
- space: cdf_cdm
externalId: CogniteAsset
version: "v1"
After that, your GraphQL query with root and path should work. For now, you can query without those fields:
query {
listPump {
items {
externalId
name
description
DesignPointFlowGPM
DesignPointHeadFT
}
}
}
To see the hierarchy, once you add CogniteAsset to the model you can query:
query {
listPump {
items {
externalId
name
parent { externalId name }
path { externalId name }
}
}
}
I think it will work. but Let me know if you hit any other issues.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support
