How to retrieve object geometry with GraphQL?

Hello Speckle :waving_hand:

I’ve been experimenting with building a knowledge-graph intelligence layer on top of the specklepy SDK. While doing this, I noticed that storing long strings of vertices and faces directly in a graph database is not very efficient, and it makes reconstructing the updated BIM model harder without additional dependencies.

1. Is it possible to pull geometry from the GraphQL API?

In the object data returned by the SDK, geometric data is usually referenced through the “displayValue” property. However, I couldn’t find it via GraphQL.

Running this query:

{
  __type(name: "Object") {
    fields {
      name
      type {
        name
        kind
      }
    }
  }
}

I can see fields like id, speckleType, createdAt, totalChildrenCount, data, and children.

  • data returns element properties but not displayValue
  • children returns a cursor

So I’m wondering if geometry is stored elsewhere and needs to be fetched differently through GraphQL.

2) Is it possible to modify an existing object through GraphQL without replacing it entirely?

I noticed ObjectCreateInput, but it seems to create new objects, and many mutations are marked as deprecated or scheduled for removal.

Any guidance would be really helpful. Thanks!

Geometry is definitely retrievable by graphql however by design this may be detached and likely chunked

1 Like

Again, by design Speckle is intended to operate as an immutable object store.

Technically it is possible to use the REST API to replace objects in situ but this is prone to failure and outside the intended supported use cases

1 Like