postgraphile filter on multiple values

Created on 25 Jun 2019  ·  2Comments  ·  Source: graphile/postgraphile

  • [ ] bug report
  • [ ] feature request
  • [x] question

PostGraphile version: 4.4.1

CLI: postgraphile --4.3.3

Steps to reproduce:

npx postgraphile -c postgres://postgres:postgres@localhost:5432/sampledb -a -j --append-plugins postgraphile-plugin-connection-filter --cors --enhance-graphiql --export-schema-graphql path\schema.graphql

I need to run a query on graphql in which query filter may contain more than one value.

For example:

{
  first: allBiometricAttendenceTable3S(filter: {ecode: {notEqualTo: ["p-01", "p-02"]}}) {
    nodes {
      sno
      ecode
      schoolName
    }
  }
}

Current behavior:
error: Expected type String, found [\"p-01\", \"p-02\"].

Expected behavior:
Should return the values corresponding to the filter options _(In this case, all values other than "p-01" and "p-02")_

Can anyone help?

❔ question

Most helpful comment

See https://github.com/graphile-contrib/postgraphile-plugin-connection-filter#operators

I believe the notIn operator should be used here.

All 2 comments

See https://github.com/graphile-contrib/postgraphile-plugin-connection-filter#operators

I believe the notIn operator should be used here.

Correct 👍

[semi-automated message] Thanks for your question; hopefully we're well on the way to helping you solve your issue. This doesn't currently seem to be a bug in the library so I'm going to close the issue, but please feel free to keep requesting help below and if it does turn out to be a bug we can definitely re-open it 👍

You can also ask for help in the #help-and-support channel in our Discord chat.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giacomorebonato picture giacomorebonato  ·  3Comments

jwdotjs picture jwdotjs  ·  5Comments

outsidenote picture outsidenote  ·  4Comments

5argon picture 5argon  ·  4Comments

calebmer picture calebmer  ·  3Comments