datocms / product-roadmap

This project is now discontinued. For feature requests, please use our community forum.
https://community.datocms.com/
19 stars 1 forks source link

Filtering single-links by`in` returns no records when given empty array #159

Closed lunelson closed 5 years ago

lunelson commented 5 years ago

Describe the bug Filtering records by single-links with in, given an empty array should return all the records, like filtering multiple-link connections with anyIn when given empty array.

To Reproduce The following query will return the first 100 Post records, because it is the equivalent of an inactive filter:

{
  items: allPosts(first: 100, filter: {series: {anyIn: []}}) {
    id
  }
}

This query will return 0 Post records.

{
  items: allPosts(first: 100, filter: {author: {in: []}}) {
    id
  }
}

Expected behavior Filtering records by single-link references using in, given an empty array of ids, should just return all of the former records, in order to be logically consistent.

matjack1 commented 5 years ago

Thank you @lunelson I think you are right. I've added this to our development backlog.

stefanoverna commented 5 years ago

Fixed!