3

I am trying to filter my results based on a one to many relationship and outlined in the documentation for postgraphile-plugin-connection-filter that outlines how to do it. I have enabled this but the options are not showing up.

I have reset the server to make sure the latest has been taken, but still not luck.

In short, the connection filter relations is not working at all. If it were, I would see the optionsenter image description here

Config

postgraphile(process.env.DATABASE_URL || dbUrl, 'public', {
  appendPlugins: [ConnectionFilterPlugin],
  connectionFilterRelations: true,
  watchPg: true,
  graphiql: true,
  connectionFilterAllowNullInput: true,
  connectionFilterAllowEmptyObjectInput: true,
  enhanceGraphiql: true,
  enableQueryBatching: true,
})

##Query

query ($firstname: String) {
  allArtists(filter: {firstname: {likeInsensitive: $firstname}, awardsByArtistIdExists: true }) {
    edges {
      node {
        artistId
        firstname
        nationality

error

{
  "errors": [
    {
      "message": "Field \"awardsByArtistIdExists\" is not defined by type \"ArtistFilter\".",
      "locations": [
        {
          "line": 2,
          "column": 65
        }
      ]
    }
  ]
}

Here is the filter enter image description here

Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291

1 Answers1

0

you need to define type jsonb for field - and it will works :)