Is anyone else experiencing generated SQL issues? #9421
-
This is moreso for my sanity to double check I did not change a setting improperly. When generating a query using the Anyone else seeing this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @MackenzieStorey From what I am seeing from your graphql query, it seems that There are two conditions here in "seperate" manner:
So because of these two clauses being seperate conditions, it results into Rectifiction to your use-case query:I get it that from syntax of introspection query, it looks confusing. But if your use-case was to get results where Docs on list based operators usage here - https://hasura.io/docs/latest/queries/postgres/query-filters/#list-based-search-operators-_in-_nin Example query query getArticlesBySpecificAuthorIds( $list_of_ids: [uuid!] = "") {
articles(where: {author_id: {_in: $list_of_ids}}) {
title
author_id
}
} variables {
"list_of_ids":
[
"56364b29-aa14-4ec9-b129-4d87d5b5da80",
"71229f10-55a1-4861-9c81-56f4b1d68a58"
]
} Alternate solution if you want to stick with
|
Beta Was this translation helpful? Give feedback.
Hey @MackenzieStorey
From what I am seeing from your graphql query, it seems that
_or
condition is never in match with that of first clause (before comma seperated)There are two conditions here in "seperate" manner:
userId
equals to given value._or
where it contains the same condition as (1)So because of these two clauses being seperate conditions, it results into
AND
in generated SQL .Rectifiction to your use-case query:
I get it that from syntax of introspection query, it looks confusing. But if your use-case was to get results where
userId
equals to either one or another value, you can solely use_in
operator i.e. list based…