askql
askql copied to clipboard
Object cannot be used as value in query?

ask {
query {
firstName1: { a:1 }
firstName2: ({ a:1 })
}
}
Returned object is empty, but { "a": 1 }
was expected
@czerwinskilukasz1 what do you think about it? Does it make sense to mix the query and value semantics like this? Where should we place a border between query
and regular value expression?
I am for allowing this kind of syntax. Why do we permit strings or ints but would forbid dictionaries? @mhagmajer , did you do research why it doesn't work? Is it parser or askcode/askvm?
Adding this test case here:
// TODO :: should we make this work?
// it(`should return an object`, async function () {
// const expectedObjectValue = {
// objectReturned: values.objectValue,
// };
//
// const queryForAnObjectValue = `query(node('objectReturned',f(object('a',call(get('get'),'objectValue')))))`;
//
// await expect(ask(queryForAnObjectValue)).resolves.toStrictEqual(
// expectedObjectValue
// );
// });