It’s an interesting debate, and we can better document some of this.
@ONO, you are right; there are many different ways to slice and dice the Revit data when electing what to send.
@Christopher_Fox Sometimes, the best strategy for Speckle operations is to make the most of the ability not to send everything in one big go. Preparing to make multiple objectively focussed queries can save some time on receiving.
A feature of the GraphQL API is the ability to alias concatenated queries to additional data points
query concatenatedQuery ($id: String!, $objectId: String!, $childCount: Int!) {
A: stream (id: $id) {
object(id: $objectId) {
children(limit: $childCount, depth: 100) {
objects {
id
}
}
}
}
B: stream (id: $id) {
object(id: $objectId) {
children(limit: $childCount, depth: 100) {
objects {
id
}
}
}
}
}
To return to your original question @ONO you can do a lot with the GraphQL API to be focussed and also expansive. I went into a few of the ways to manipulate your queries in an open office session last year: https://youtu.be/J0SbxMFFbfc?si=XK5yonTcXMydhSmw
Adding a query
to the children object allows you to specify a singular speckle_type
Adding a select
field to the children object allows you to specify the list of parameters you are interested in
Therefore, combining my answer to @Christopher_Fox with your original intended use case retrieves MEP Connectors
for two separate versions (and parameterises these for both queries":
Query
query groupCommits($id: String!, $myQuery: [JSONObject!], $select: [String], $depth: Int!, $commitReferencedObjectId1: String!, $commitReferencedObjectId2: String!, $childCount: Int!) {
commit1: stream(id: $id) {
object(id: $commitReferencedObjectId1) {
id
children(select: $select, query: $myQuery, limit: $childCount, depth: $depth) {
objects {
id
data
}
}
}
}
commit2: stream(id: $id) {
object(id: $commitReferencedObjectId2) {
id
children(select: $select, query: $myQuery, limit: $childCount, depth: $depth) {
objects {
id
data
}
}
}
}
}
Parameter variables:
{
"id": "da888___",
"commitReferencedObjectId1": "1590a069d983fdf3dc6____",
"commitReferencedObjectId2": "dc62f5e7903d76ae159____",
"childCount": 3,
"depth": 10,
"select": [
"systemName",
"speckle_type",
"applicationId"
],
"myQuery": [
{
"field": "speckle_type",
"value": "Objects.BuiltElements.Revit.RevitMEPConnector",
"operator": "="
}
]
}
Indicative output of this would be:
{
"data": {
"commit1": {
"object": {
"id": "1590a069d983fdf3dc62f5e7903d76ae",
"children": {
"objects": [
{
"id": "005cec1c1b3cd09976f326e0cb32468a",
"data": {
"systemName": "P-ARPIS VENT 21",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-000451eb.1",
"id": "005cec1c1b3cd09976f326e0cb32468a"
}
},
{
"id": "013f03caee4966561103a7d725b3fa86",
"data": {
"systemName": "P-ARPIS SAN 7",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-0004514d.3",
"id": "013f03caee4966561103a7d725b3fa86"
}
},
{
"id": "0168671cb2ab7d84336e4997b292934e",
"data": {
"systemName": "P-ARPIS VENT 7",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-000451a1.2",
"id": "0168671cb2ab7d84336e4997b292934e"
}
}
]
}
}
},
"commit2": {
"object": {
"id": "1590a069d983fdf3dc62f5e7903d76ae",
"children": {
"objects": [
{
"id": "005cec1c1b3cd09976f326e0cb32468a",
"data": {
"systemName": "P-ARPIS VENT 21",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-000451eb.1",
"id": "005cec1c1b3cd09976f326e0cb32468a"
}
},
{
"id": "013f03caee4966561103a7d725b3fa86",
"data": {
"systemName": "P-ARPIS SAN 7",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-0004514d.3",
"id": "013f03caee4966561103a7d725b3fa86"
}
},
{
"id": "0168671cb2ab7d84336e4997b292934e",
"data": {
"systemName": "P-ARPIS VENT 7",
"speckle_type": "Objects.BuiltElements.Revit.RevitMEPConnector",
"applicationId": "9819452a-0461-4d94-bca6-5b6a1b881d7b-000451a1.2",
"id": "0168671cb2ab7d84336e4997b292934e"
}
}
]
}
}
}
}
}