Skip to content

Alias field multiple times in one query doesn't seem to work #3668

@rickardoberg

Description

@rickardoberg

The basic issue is that my schema has a generic field ("aggregate") which returns different things depending on arguments (it calculates various aggregation functions basically). Typically client will provide query with this field many times, with different arguments and different aliases.

But this doesn't seem to be supported by the default ExecutionStrategy, because it looks up DataFetcher based on field name and not field alias in query. The result is that the fetched data cannot return this field many times with the different variations. The data can only be provided with the original name, which therefore can only appear once (assuming Map<String,Object> with regular PropertyDataMatcher is used).

This basically seems like a design issue more than anything else. The assumption appears to be that the backend data returns the same data no matter the arguments, and so returning the same field many times in the same query with different arguments is simply not considered.

Have I understood it correctly? Or is there a way to have a query return the same field many times with different aliases and arguments that I have missed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions