Solved

How to modify GraphQL filter using direct relation object name

  • 4 January 2024
  • 3 replies
  • 52 views

Badge +4

I am learning GraphQL queries in Congite by following the documentation About data modeling | Cognite Documentation

How can I add an additional filter condition based on functionalLocationParent object name value.

query{
listEquipment (filter: {and: [{catalogProfileDescription: {eq: "Compressors"}}]}) {
  items { 
    externalId
    name
    description 
    catalogProfileDescription
    functionalLocationParent {
      name
      description
    }
    cfihosEquipmentClass {
      name
      description
    }
  }
}
}

icon

Best answer by Dilini Fernando 9 February 2024, 11:26

View original

3 replies

Userlevel 1
Badge

Hi @sudheerchonate ,

Could you please try using a filter similar to the one below?

 listEquipment (filter: {
and: [
{catalogProfileDescription: {eq: "Compressors"}},
{functionalLocationParent: { name: { eq: "XXXXXX" } } }
]
})

Regards,

Kanchana

Userlevel 4
Badge +2

Hi @sudheerchonate,

Did you manage to try Kanchana’s suggestion?

Best regards,
Dilini

Userlevel 4
Badge +2

Hi @sudheerchonate,

I hope you were able to try out Kanchana’s suggestion. As of now, I will close this thread. If you have any questions, please feel free to create a post on Hub.

Br,
Dilini 

Reply