graphjin icon indicating copy to clipboard operation
graphjin copied to clipboard

Question: Problem with `where` argument in Graphjin query

Open quocduongpy opened this issue 7 months ago • 1 comments
trafficstars

❓ Question: Problem with where argument in Graphjin query

Describe the problem
I'm trying to query a list of uploads using Graphjin with a where clause, but I keep getting the following error:

{ "error": "where: value for argument 'where' must be or a object" }


My GraphQL Query

query ($where: uploads_bool_exp) {
  uploads(where: $where, order_by: { created_at: desc }) {
    id
    name
    size
    private
    ext
    user_id
    url
    created_at
    updated_at
    deleted_at
  }
}
Variables sent
{
  "where": {
    "private": true
  }
}
Also tried:
{
  "where": {
    "private": { "_eq": true }
  }
}

And:
{
  "where": {
    "private": { "_eq": true },
    "deleted_at": { "_is_null": true }
  }
}

But the error remains similar:

where: expecting an object

value for argument 'where' must be or a object
Table Schema
CREATE TABLE uploads (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  size BIGINT NOT NULL,
  private BOOLEAN DEFAULT false,
  path TEXT NOT NULL,
  ext VARCHAR(50),
  user_id INTEGER NOT NULL,
  url TEXT,
  created_at TIMESTAMPTZ DEFAULT now(),
  updated_at TIMESTAMPTZ DEFAULT now(),
  deleted_at TIMESTAMP
);

What I'm asking for

Am I using the correct format for where in the Graphjin context?

Is this a bug or a limitation in how Graphjin parses object variables?

Has anyone faced and solved this error before?

Thanks in advance for your support!

quocduongpy avatar Apr 23 '25 03:04 quocduongpy