Aliases for extra results
GraphQL supports field aliases which can lead to duplicate fields with different arguments and different sub fields. This is problem especially for extra results e.g. facetSummary where we support only one summary for each reference. Unfortunately, in GraphQL client can sent following query:
facetSummary {
brand {
groupEntity {
primaryKey
}
}
otherBrand: brand(filterGroupBy: {}) {
groupEntity {
attributes {
code
}
}
}
}
this GraphQL query would need 2 separate summaries for the same reference with different filters and entity requirements.
This could by supported by evitaDB if each summary could be identified by outputName similary to hierarchies rather than references. The idea of outputName could be maybe used in other extra results like histograms for the same purposes.
There is also a problem with inner facet statistics collections which could be also duplicated but inside one summary. This cannot be solved simply with outputName. One idea is to fetch multiple summaries with otherwise same properties except for the facet statistics and then in GraphQL resolution somehow merge it together.
For now, we will support only one summary of single reference and throw an error otherwise.