graphile-contrib / postgraphile-plugin-connection-filter

Filtering on PostGraphile connections
MIT License
286 stars 32 forks source link

Filter in or possibly not working #192

Closed schrepfler closed 1 year ago

schrepfler commented 1 year ago

Could be mistaken but trying something like this in the filter with and and or always gives back the same SQL explain so possibly the or expression is not implemented?

filter: {
      and: {
        eventHasTmsPricesByEventId: {
          some: { hasTmsPrices: { equalTo: true } }
        }
        eventHasInternalPricesByEventId: {
          some: { hasInternalPrices: { equalTo: false } }
        }
      }
    }
mattbretl commented 1 year ago

The or field requires an array of conditions. (There's no validation error because the GraphQL spec allows supplying a single object for a List field.)

See this example in the docs for how to use or.

schrepfler commented 1 year ago

I can confirm it works using an array, thank you very much!