Filtering Speckle Commit Data by Object Type (GraphQL Query)

Hi @jonathon

Quick follow-up on the proposed solution of using GraphQL.

Our use case: extracting a materials table

When we get all data of a commit we see different object types. To narrow down the query, we need to understand these objects types first.
Is there any document / resource for definition of speckle types we see in the output? Without understanding which type we need, how we can provide this in our query?

query for getting all data of a commit

commit_query = f"""
{{
project(id: "{project_id}") {{
	object(id: "{commit_ref_id}") {{
	children {{
				objects {{
				id
				speckleType
				data
				}}
			}}
		}}
	}}
}}
"""

query that we pass “variables” to get filtered data according to Speckle types

graphql_query = """
query getWallsOfCommit($projectId: String!, $objectId: String!, $myQuery: [JSONObject!]) {
project(id: $projectId) {
object(id: $objectId) {
children(query: $myQuery, limit: 1000) {
totalCount
objects {
id
speckleType
data
}
}
}
}
}
"""

@gmaz sorry for the delay. The prior thread being closed confused my action list.

The SpeckleSharp Objects repository is the closest resource we have for a comprehensive list of predefined Speckle object types.

This repository contains the different object types implemented in the Speckle .NET SDK, which includes a variety of standard objects like Wall, Beam, Column, and Material, along with their properties and methods. This list can help you better understand the object types you’ll encounter in your Speckle queries, especially for filtering purposes in your GraphQL queries.

For practical use:

  • Browse through the classes defined in that repository to see which types correspond to your specific use case.
  • Map those types (e.g., Material, Wall) to the speckleType field in your queries to filter the data accordingly.

This should give you the clarity needed to refine your GraphQL queries based on the object types you’re working with. If you run into any specific filtering or query optimization issues, feel free to share the details!