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

The auto generated id_in leads to invalid query #21

Open
xcv58 opened this issue Oct 17, 2018 · 3 comments
Open

The auto generated id_in leads to invalid query #21

xcv58 opened this issue Oct 17, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@xcv58
Copy link

xcv58 commented Oct 17, 2018

if (!!inputField) {
return {
...acc,
[key]: { id_in: params.filter[key] }
};
}

The filter like { id_in: ['id_1', 'id_2'] } will lead to query variables like:

{
   "where": {
    "id_in": { "id_in": ["id_1", "id_2"] }
  }
}

Which is not a valid query anymore.

@Weakky
Copy link
Owner

Weakky commented Oct 17, 2018

Hey there,

Could you please provide the components you're using to end up into this bug?

Thanks 🙏

@Weakky Weakky added the bug Something isn't working label Oct 17, 2018
@xcv58
Copy link
Author

xcv58 commented Oct 17, 2018

Sure, the component is react-admin List: https://marmelab.com/react-admin/List.html#permanent-filter

The query like this:

{
  posts (where: { title_in: ["Hello World", "My Second Post"] }) {
    id
    title
  }
}

will turn to:

{ title_in: { id_in: ["Hello World", "My Second Post"] } }

The link for the query: https://graphqlbin.com/v2/YvW2uN

@xcv58
Copy link
Author

xcv58 commented Oct 18, 2018

@Weakky I reproduce the bug here: https://github.com/xcv58/ra-data-opencrud-issue-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants