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

Improve the "Ignoring keys" warning #25

Open
matthewp opened this Issue Nov 13, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@matthewp
Copy link
Contributor

matthewp commented Nov 13, 2018

It's common to see warnings such as:

can-query-logic: Ignoring keys: foo, bar

I think we an improve on this in a few ways:

  1. Make it more clear that this occurs when a query is requested (ie, when someone does Todo.getList(query). One idea is to log the actual query object.
  2. Point out that this often occurs when a custom Query Logic is needed and link to documentation about that.
  3. It's possible that you simply forget to wrap your query in filter: query. Not sure how to aid with this case.
@justinbmeyer

This comment has been minimized.

Copy link
Contributor

justinbmeyer commented Nov 13, 2018

1. What a key is.

A key is a property on a query object. For example, you might do .getList({foo: "bar"}) ... foo is a key that isn't understood by QueryLogic.

2. When this occurs. Is it when a query is defined? is it when a request is made? Is it when a request is received.

It's when a query object like {foo: "bar"} is hydrated into new BasicQuery(). This happens when any query operation takes place. .filterMembers, .union, etc.

3. Why are the keys being ignored? What does it even mean to ignore a key?

The key are ignored because QueryLogic by default only understands these keys: https://canjs.com/doc/can-query-logic/query.html

To ignore a key means QueryLogic does nothing with it.

4. Are keys being ignored bad? Did I do something wrong? If so, what did I do wrong?

Sometimes it's bad. It might (as it means in this case), that you've not mapped your service's API to what QueryLogic expects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment