Hi,
in order to fetch some fields from a commit in Globals, I do the following two GraphQL queries.
- I fetch all commits reference Ids of Globals branch
- and then I get the last referenceId to fetch the content of that, e.g.
Query 1:
query{stream (id:"a18f8c8569" ){
branch(name: "globals" )
{commits{
totalCount
items{
referencedObject
message
sourceApplication
authorName
authorId
}
}
}
}
}
Result 1
{
"data": {
"stream": {
"branch": {
"commits": {
"totalCount": 10,
"items": [
{
"referencedObject": "32300995215e45ed7e39015e6cb835bf",
"message": "Change Region",
"sourceApplication": "web",
"authorName": "Dimitrios Ververidis",
"authorId": "4ea81c889c"
},
{
"referencedObject": "f5a64bc4848d52ac995056919764394a",
"message": "Change Region",
"sourceApplication": "web",
"authorName": "Dimitrios Ververidis",
"authorId": "4ea81c889c"
},
{
"referencedObject": "a86eaef0cc8ae6b33001a41803ee6d2b",
"message": "Back to 45 height",
"sourceApplication": "web",
"authorName": "Dimitrios Ververidis",
"authorId": "93c67be9d1"
},
Query 2
query{stream (id:"a18f8c8569")
{id
object(id:"32300995215e45ed7e39015e6cb835bf"){
id
data
}
}
}
Result 2:
{
"data": {
"stream": {
"id": "a18f8c8569",
"name": "ZH Villa ",
"description": "PrismArch project villa use case",
"updatedAt": "2022-05-12T14:29:54.973Z",
"createdAt": "2021-11-09T07:12:24.832Z",
"role": "stream:owner",
"isPublic": false,
"object": {
"id": "32300995215e45ed7e39015e6cb835bf",
"data": {
"id": "32300995215e45ed7e39015e6cb835bf",
"Height": 45,
"Region": [
"Europe",
"Greece",
"Thessaloniki"
],
"Climate": {
"id": null,
"speckle_type": "Base",
"Summer DBT [C]": 35,
"Summer WBT [C]": 20,
"Winter DBT [C]": -4,
"Winter WBT [C]": -4
},
"Country": "Greece",
"Latitude": 40.51,
"Continent": "Europe",
"Longitude": 22.94,
"Postal Code": 57001,
"Project Code": "Nemesis",
"speckle_type": "Base",
"Administration Level 1": "Thessaloniki",
"Administration Level 2": "Thermi",
"Administration Level 3": "Thermi",
"totalChildrenCount": 0
}
}
}
}
}
Do you support the submission two graphQL queries as one where these two have depended fields, i.e. the referenceId
???
There are three options : Using Apollo Link to Handle Dependent Queries - Apollo GraphQL Blog