Code Monkey home page Code Monkey logo

Comments (8)

Prabhanjali avatar Prabhanjali commented on May 29, 2024 1

Hey! I found the issue,
I just missed placing connectionFilterRelations: true inside graphileBuildOptions.

graphileBuildOptions: {
      connectionFilterRelations: true, // default: false
 }

Adding this worked!

from crystal.

benjie avatar benjie commented on May 29, 2024

This is more a question for the filter plugin, but something like this:

{
  AAAA(filter: {ab: {isNull: false}, BBBB: { type: { isEqual: "ccdd" } }}) {
    nodes {
      id
      BBBB{
        type
      }
    }
    totalCount
  }
}

You need to turn on relational filters; see: https://github.com/graphile-contrib/postgraphile-plugin-connection-filter?tab=readme-ov-file#connectionfilterrelations

from crystal.

Prabhanjali avatar Prabhanjali commented on May 29, 2024

What should be the version of the postgraphile for this filter to work?

This filter is not working in this version
"postgraphile": "^4.13.0",
"postgraphile-plugin-connection-filter": "^2.3.0"

from crystal.

benjie avatar benjie commented on May 29, 2024

Any release from the last couple years should work; do make sure you read the filter plugins documentation though - especially the part I mentioned above about enabling relational filters.

from crystal.

Prabhanjali avatar Prabhanjali commented on May 29, 2024

This is not working for me,
image
I am getting the above error.

I have added this connectionFilterRelations: true. But still it is not working
Can you please let me know what is causing the issue?

from crystal.

benjie avatar benjie commented on May 29, 2024

Seems like you’re querying field 🟥🟥🟥🟥 on type 🟥🟥🟥🟥, but that field doesn’t exist. You should use GraphiQL or similar to build your query so it will show you what’s wrong.

from crystal.

Prabhanjali avatar Prabhanjali commented on May 29, 2024

This is the query I am using

{
  Users(
    filter: {userName: {equalTo: "raghav"}, Account: {accountStatus: {equalTo: "active"}}}
  ) {
    nodes {
      userName
      Account {
        accountName
        accountId
        accountStatus
      }
    }
    totalCount
  }
}

Error:
"message": "Field "Account"" is not defined by type "UsersFilter".

from crystal.

benjie avatar benjie commented on May 29, 2024

Great; glad it's working! You should note that this is exactly what I linked you to 3 weeks ago and then referenced again 3 days ago.

image

from crystal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.