Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object cannot be used as value in query? #312

Open
mhagmajer opened this issue Jul 2, 2020 · 3 comments
Open

Object cannot be used as value in query? #312

mhagmajer opened this issue Jul 2, 2020 · 3 comments
Labels
AskScript ./src/askscript/** AskVM ./src/askvm/** bug Something isn't working discussion A discussion is taking place, please don't work on it yet

Comments

@mhagmajer
Copy link
Contributor

Screenshot 2020-07-02 at 12 55 11

ask {
  query {
    firstName1: { a:1 }
    firstName2: ({ a:1 })
  }
}

Returned object is empty, but { "a": 1 } was expected

@mhagmajer mhagmajer added bug Something isn't working AskScript ./src/askscript/** AskVM ./src/askvm/** labels Jul 2, 2020
@mhagmajer mhagmajer added the discussion A discussion is taking place, please don't work on it yet label Oct 9, 2020
@mhagmajer
Copy link
Contributor Author

@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?

@czerwinskilukasz1
Copy link
Collaborator

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?

@YonatanKra
Copy link
Collaborator

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
  //   );
  // });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AskScript ./src/askscript/** AskVM ./src/askvm/** bug Something isn't working discussion A discussion is taking place, please don't work on it yet
Projects
None yet
Development

No branches or pull requests

3 participants