Is there a means of querying (GraphQL) objects not dependant on a commit?

Is there a form of GraphQL query of a stream where a parameter data match can be set as a search term?

For a given #applicationId, for instance, querying against that amongst all objects in a stream would allow the changes over time for that singular object. (Subsequent commits only generating a new object in the stream if the serialized object has changed. And assuming no edge cases of #applicationId collisions)

I’m asking for a use case where a Base object includes other objects by reference and have need to keep that reference up-to-date to the most recent commit of that object.

To abstract that out for a moment,

  • the main Branch consists of commits to models in a typical manner
  • a second Branch is populated to re-categorise or pivot those models in a different way, akin to the filter categories, say.
  • commits to the second Branch are grouped at the top-level by a parameter with children reference by Id

Time for some pseudoBase…

Main Branch

Base {
  @Doors [
     { 
       id: …1, applicationId: A
       colour: Red
     }
     { 
       id: …2, applicationId: B
       colour: Blue
     }
  ]
  @Walls [
     { 
       id: …3, applicationId: C
       colour: Green
     }
     { 
       id: …4, applicationId: D
       colour: Blue
     }
  ]
}

Categorised Branch

Base
  @RedObjects [
     { referenceId: …1, speckle_type: reference }
  ]
  @BlueObjects [
     { referenceId: …2, speckle_type: reference }
     { referenceId: …4, speckle_type: reference }
  ]
  @GreenObjects [
     { referenceId: …3, speckle_typer: reference }

A second main branch commit amends Wall with applicationId C and consequently has a new Id

{ 
  id: …7, 
  applicationId: C, 
  color: Green,
  + newFinishesParameter: ExpensivePaint
}

I’m wondering how to keep the Categorised Branch up to date with the new generated Id??? I’m assuming this wouldn’t be automatically handled by the server (I haven’t checked)

At the minute I’m re-parsing the Branches (I have several) and committing to each with every change.

Is there a better strategy available?

Hi @jsdbroughton, unfortunately there’s no such endpoint there yet; your use case is legit though. This would be quite cool in showing version changes, as you mention!

I’m not entirely sure how the categorised branch is used, or should be used. The only thought i have here is that we could allow a reference by applicationId (pending the query above) that would resolve to the “latest”.

As an aside, and I’m wondering if having and objects edit endpoint would actually help applying that layer of expensivePaint easier :sweat_smile:

I have rather overreached in my hackathon plan. So, while I would say “watch this space”, it may take longer than 2 days and a video edit :+1: :smiley: :man_facepalming: :smiling_face_with_three_hearts:

3 Likes