Help with Query to get all materials

Hi API ninjas,

I was hoping to write a GraphQL query to return all the renderMaterials in a model in a singular list.

My best attempt uses a query parameter to filter out objects where renderMaterial = null. ie.

"myQuery": {
    "field": "renderMaterial",
    "value": "null",
    "operator": "!="
}

unfortunately, that shows the objects with materials but there are a lot of duplicates because multiple objects use the same material.

Any thoughts on how I could achieve just a simple list of renderMaterials?

Hey @miketalbott ,

I don’t think we have a native DISTINCT feature in our GraphQL API, so you’ll have to handle it in the client side.

@jonathon @gjedlicska can correct me if I’m wrong.

2 Likes