-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Can't sort by multiple nested fields #3796
Comments
You have to use " , " between two orderby statements. |
I also get this error, regardless of whether I use a Same error in Hasura v1.2 and v1.3. Example - query 'One' succeeds, but query 'Two' fails:
✅
❌ ORDER BY "root.ar.root.accounts.ar.accounts.balances.pg." is ambiguous Here's the error output:
|
@r-moore can you attach your schema representation in graphiql, since
It might not be a issue with hasura. I think its a issue with your schema setup, since I have been using Hasura v1.2 and I have not encountered any error with |
It works for me when the nesting is 1 level deep, but not 2. Using a Another example:
and
...both work but this does not:
I will need to check about sharing schema publicly as it is related to a client project. |
I copied part of our schema to a fresh Hasura instance and it works 🤔 Some tables were renamed a while back (from PascalCase to snake_case) leaving the constraints and index names in PascalCase... I don't think that could be causing this issue. I will keep looking in to our schema to see what is different |
You can try to reset metadata of your hasura app to resolve this problem. Go to:
|
Here's a schema that it is reproducible on:
With this query:
|
I've just tried resetting the metadata and retracking all tables & relationships but the error persists |
Your schema seems fine, if its working if you replicate the same schema to other app then there might be a issue in your relation settings if you changed name of some fields related to that relation. |
I'm hitting the same issue. When I have multiple order by clauses, it works when the GQL query is not nested, but if it's nested I get a similar "column reference is ambiguous" error. |
Yeah just to be clear I can reliably reproduce this with a brand new Hasura instance and the schema posted above. I don't believe it has anything to do with changing relation settings or names of fields |
Any word on a fix here? |
I faced a similar issue out of nowhere after some debugging it looks like it doesn't happens on |
I got the same issue when using |
I have the same issue.. |
I have the same issue on version |
I'm also having this issue |
I'm also having this issue, any updates? |
I just encountered this on 2.x as well. |
Hey, folks. Thanks for your patience and detailed bug report. We'll be triaging this soon, and will update here with progress. Confirming I can repro with the following: DDL on Postgres create table customers ("id" serial NOT NULL PRIMARY KEY);
create table business_units
(
"id" serial NOT NULL PRIMARY KEY, customer_id INT,
CONSTRAINT fk_customer FOREIGN KEY(customer_id) REFERENCES customers(id)
);
create table accounts
(
"id" serial NOT NULL PRIMARY KEY, business_unit_id INT,
CONSTRAINT fk_business_unit FOREIGN KEY(business_unit_id) REFERENCES business_units(id)
);
create table balances
(
"id" serial NOT NULL PRIMARY KEY, account_id INT,
date TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT now(),
CONSTRAINT fk_account FOREIGN KEY(account_id) REFERENCES accounts(id)
); and importing the schema and query linked above. |
Hey folks. Thanks again for your patience. We have merged a fix for this bug at ee15c80 and it will be available in the next stable release within two weeks. In the meantime, you can try it out using the Docker image |
query
gives error
removing one of order rules gives normal result
The text was updated successfully, but these errors were encountered: