pimcore / data-hub

Data delivery & consumption platform for Pimcore.
Other
127 stars 109 forks source link

ObjectBricks with identical attributes are not working #165

Closed mugge6 closed 4 years ago

mugge6 commented 4 years ago

If I create two ObjectBricks with an attribute with the same name (e.g. title) and add it to a DataObject. Both will show up in DataHub configuration and I can drag'n'drop them to the schema. But if I'm calling it from the webservice with:

query ($id: Int!, $lang: String!) {
  product: getProduct(id: $id, defaultLanguage: $lang) {
    ... on object_Product {
      title
    }
  }
}

It returns null. And it's not clear, which title from which ObjectBrick is called.

Another problem: It's not obvious if the title field is coming from an ObjectBrick or if it's an attribute from the Object itself.

weisswurstkanone commented 4 years ago

Try to use the alias operator.

https://github.com/pimcore/data-hub/blob/master/doc/graphl/Operators.md

mugge6 commented 4 years ago

Yeah, it's working with the alias operator.