I have the following GraphQL query, which i right now use to query drawings in my Revit project:
query ($stream_id: String!, $object_id: String!, $myQuery: [JSONObject!]) {
stream(id: $stream_id) {
id
name
object(id: $object_id) {
id
children(query: $myQuery, limit:1) {
cursor
totalCount
objects {
data
}
}
}
}
}
and the following query variables:
{
"stream_id":"some-id",
"object_id":"some-id",
"myQuery": [
{
"field": "category",
"value": "Sheets",
"operator": "="
}
]
}
This gives me the following result:
{
"data": {
"stream": {
"id": "some-id",
"name": "Project name",
"object": {
"id": "some-id",
"children": {
"cursor": "eyJmaWVsZCI6ImlkIiwib3BlcmF0b3IiOiI+IiwidmFsdWUiOiIwMzc0Y2I0YjM1MzAwYTRjM2YwYzU1NGNiMmRkNWJiNSJ9",
"totalCount": 92,
"objects": [
{
"data": {
"id": "0374cb4b35300a4c3f0c554cb2dd5bb5",
"name": null,
"units": "mm",
"category": "Sheets",
"elementId": "3251288",
"worksetId": "19770",
"parameters": {
"id": "570949903beedf362097150913b35731",
"EDITED_BY": {
"id": "306def54fbcd9c5dff9b81f269656c85",
"name": "Edited by",
"units": null,
"value": "",
"isShared": false,
"isReadOnly": true,
"speckle_type": "Objects.BuiltElements.Revit.Parameter",
"applicationId": null,
"applicationUnit": null,
"isTypeParameter": false,
"totalChildrenCount": 0,
"applicationUnitType": null,
"applicationInternalName": "EDITED_BY"
},
"VIEW_TYPE": {
"id": "b75ecdcb71cf0b31966041437dd9eeb0",
"name": "Family and Type",
"units": null,
"value": "Sheets",
"isShared": false,
"isReadOnly": true,
"speckle_type": "Objects.BuiltElements.Revit.Parameter",
"applicationId": null,
"applicationUnit": null,
"isTypeParameter": false,
"totalChildrenCount": 0,
"applicationUnitType": null,
"applicationInternalName": "VIEW_TYPE"
},
...
},
"speckle_type": "Objects.BuiltElements.View",
"applicationId": "7baecc91-890f-4376-bafd-4e4918105264-00317a7d",
"renderMaterial": null,
"builtInCategory": "OST_Sheets",
"isRevitLinkedModel": false,
"materialQuantities": [],
"totalChildrenCount": 0,
"revitLinkedModelPath": "some-link"
}
}
]
}
}
}
}
}
I am only interested in the value
and name
inside of each parameter, therefore i was hoping to be able to do this select
statement in the children
query, so that i can recieve all the parameters in the query, but only the value
and name
in each of them:
children(query: $myQuery, select:["parameters.*.value", "parameters.*.name"], limit:1) { ... }
This does not work… Is there a solution for this? And are the capabilities of the select
statement documented somewhere?