Skip to content

Question: Problem with where argument in Graphjin query #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quocduongpy opened this issue Apr 23, 2025 · 0 comments
Open

Question: Problem with where argument in Graphjin query #522

quocduongpy opened this issue Apr 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@quocduongpy
Copy link

❓ 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 quocduongpy added the bug Something isn't working label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant