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

"and" as alias of "filtering" and "or" as alias of "filtering_or" #80

Open
sensorario opened this issue Jan 5, 2018 · 1 comment
Open

Comments

@sensorario
Copy link
Contributor

It could be better if a query like

?filtering[bar|op1]=value1&filtering[foo|op2]=value2

could be writeable as

?and[bar|op1]=value1&and[foo|op2]=value2

from query string and as {"and|or": {"bar": {"op1": "value1"},"foo": {"op2": "value2"}}}

{
    "and|or": {
        "bar": {
            "op1": "value1"
        },
        "foo": {
            "op2": "value2"
        }
    }
}

So then we'll query api directly with json.

@sensorario
Copy link
Contributor Author

sensorario commented Jan 6, 2018

I've made an npm package to do this:

var queryQl = new QueryQl()
queryQl.json({
  '_embedded.relation.nick', '@sensorario',
  '_embedded.foo.bar.name', 'Simone'
});
var querystring = queryQl.getQueryString();

This javascript creates a query like this:

rel=relation,foo,bar&filtering[_embedded.relation.nick]=@sensorario&filtering[_embedded.foo.bar.name]=Simone

@sensorario sensorario added this to the 2.4 milestone Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant