WIP: expose parser result in GQL API
Created by: rvantonder
SRC_ENDPOINT=http://localhost:3080 SRC_ACCESS_TOKEN="<...>" src api -query='query { parseSearchQuery(query: "-repo:foo a or b") }'
{
"data": {
"parseSearchQuery": "[{\"operator\":\"or\",\"operands\":[{\"operator\":\"and\",\"operands\":[{\"field\":\"repo\",\"value\":\"foo\",\"negated\":true},{\"field\":\"\",\"value\":\"a\",\"negated\":false}]},{\"field\":\"\",\"value\":\"b\",\"negated\":false}]}]"
}
}
TODO:
- Call this
parseTree
instead? - Simplify JSON or parser to distinguish parameter/pattern?
- Document decision above.
- Change format to be
"op" : [ list of children ]
? I think so... - Return disambiguated query?
- Have GQL type accomodate suggestions?
- Have GQL type expose heurstic vs. spec?
- Changelog