Skip to content

Question: Problem with where argument in Graphjin query #522

Description

@quocduongpy

❓ 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions