Open crissi opened 2 years ago
I think the purpose of the query plan is to allow the server to make decisions on how to resolve the query efficiently. Given aliases are given by the client and transparently handled by the execution engine of this library, they do not seem useful to include.
yes, but since each alias can have different arguments like in my example.
Here it just returns the argument of the last schemesCount property.
Right, that is misleading. args
should really be a list with multiple args passed to the different aliases - same with fields
actually. Perhaps a better structure would be:
{
"fields": {
"schemesCount": {
"type": "Int",
"aliases": [
{
"fields": [],
"args": {}
},
{
"fields": [],
"args": {
"status": "APPROVED"
}
},
{
"fields": [],
"args": {
"status": "CLOSED"
}
},
]
}
}
}
maybe include the alias name in there for good measure
We are having the same issue. We use the queryPlan to dynamically build an ElasticSearch query. Some fields have quite some possible arguments, therefore we want to be able to alias those fields.
Unfortunately, the only alternative for now is duplicating these fields.
Running lookAhead with queryplan with this query:
Gives us:
I suspect all fields should be included somehow in the result!