[DataHub] How to use object bricks in schema

Hi there,

I am currently trying to define Schemas for a rather complex article class structure. What makes it complex is, that two fields (“articleGroup” and “dimensionGroup”) should be object bricks where “articleGroup” can be one of 4 different bricks, and “dimensionGroup” can be one of 11 different bricks. Each of those bricks has another 1 to 15 fields. Additionally, some of the fields inside the bricks have identical names - general fields like an ID or a description.

When plugging together the article schema I noticed, that I can only add all those fields of the bricks separately. There is no way to just drag the whole object brick into the schema, nor is there a way to group them under some parent node or so. This would result in a very large documentation when viewing this schema in GraphiQL Explorer and a lot of field names would occur multiple times.

I thought about wrapping some of the fields with an “Alias” and go for an “ObjectBrick-fieldName” naming convention or so. But still, the article would have a very long list of possible properties that are not clearly structured.

Is there a best practice for working with object bricks in GraphQL schemas already?
Is better support for object bricks planned for the near future?
Does anyone have an idea of how to work around this problem?

Thanks in advance,
Markus

1 Like

I got the exact same problem. ClassificationStores are way easier to handel in datahub.
A better support for ObjectBricks would be awesome.

I tried to do a workund around with @include(if : bool) but i dont know how to set the boolean variable dynamically. So i could insert a hidden non editable checkbox to every ObjectBrick which is by default set to true. With that i could d something like
query {
objectbrickfield1 @include(if: $isSet1)
}
But there is no chance to fill the $isSet variable with the value of the checkbox.