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

Feature Request: add support operator "in" for types string, int, float #2277

Closed
3axap4eHko opened this issue Sep 29, 2017 · 6 comments
Closed

Comments

@3axap4eHko
Copy link
Contributor

3axap4eHko commented Sep 29, 2017

It would be great to have support of in operator for scalar types to create simple queries with arrays like:

{
  allMarkdownRemark(
    filter: {
      id: { in: ["0","1"] }
    }
  ) {
    edges{
      node {
        id
      }
    }
  }
}

for now I need to build regexp

@3axap4eHko 3axap4eHko changed the title Feature Request: add support operator "in operator for types string, int, float Feature Request: add support operator "in" operator for types string, int, float Sep 29, 2017
@3axap4eHko 3axap4eHko changed the title Feature Request: add support operator "in" operator for types string, int, float Feature Request: add support operator "in" for types string, int, float Sep 29, 2017
@KyleAMathews
Copy link
Contributor

Oh interesting!

So the above would turn into something like ["0", "1"].some(f => _.includes(id, f))

@3axap4eHko
Copy link
Contributor Author

I guess it should be in ES6 notation like ["0","1"].includes(id) =)

@KyleAMathews
Copy link
Contributor

So it's an equality match then? You basically want eq for for matching against multiple things?

@3axap4eHko
Copy link
Contributor Author

Against multiple things passed through arguments

@3axap4eHko
Copy link
Contributor Author

it's something like $in in mongodb

@chmac
Copy link
Contributor

chmac commented Feb 18, 2018

This would be really helpful for pagination. For example, I have ~2k blog posts, I'm showing 15 per page. Being able to query for an array of post IDs would be helpful in the pageQuery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants