-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
GraphQL where clause not working for ContentItemIndex fields #3684
Comments
@carlwoodhouse ^^^^ |
Yeah assume this is a bug with table prefixes, I can take a look this week sometime if no one else does |
… when table prefix is used (#3692)
Fixes OrchardCMS#3684 - GraphQL where statements dont work for contentitemindex…
@carlwoodhouse Thank you for fix. However, that resolves only 1 of the 2 problems I reported with the query.
The following problem is not resolved:
Please reopen this bug as I can't seem to. |
Urf guessing it’s a Postgres thing :/ the case sensitivity
…On Thu, 23 May 2019 at 18:12, Abhay Saraf ***@***.***> wrote:
@carlwoodhouse <https://github.com/carlwoodhouse> Thank you for fix.
However, that resolves only 1 of the 2 problems I reported with the query.
1. Please look at the 3rd where parameter where the ContentItemIndex
table doesn't have the appropriate table prefix unlike rest of the items.
The following problem is not resolved.
1. contentItemId retains the camelCasing instead of the PascalCased
column name expected.
Please reopen this bug as I can't seem to.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3684?email_source=notifications&email_token=AADRUECYJWTVGIO7U647ORTPW3F6NA5CNFSM4HOV46HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWC4EYY#issuecomment-495305315>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADRUEBTATJ7HNZCVIPZJV3PW3F6NANCNFSM4HOV46HA>
.
|
Yes, this is the log from postgres:
|
The orderBy implementation in the same file |
I’ll take a look later. Need to think about it a bit as the where is more
dynamic and can be used with custom indexes, where the casing could be
anything.
…On Thu, 23 May 2019 at 18:16, Abhay Saraf ***@***.***> wrote:
The orderBy implementation in the same file ContentItemsFieldType.cs
solves by putting a switch case
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3684?email_source=notifications&email_token=AADRUEDRYMP4QBHFJBNX4ETPW3GOLA5CNFSM4HOV46HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWC4QWQ#issuecomment-495306842>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADRUEF2F426W2BHSBPFKXLPW3GOLANCNFSM4HOV46HA>
.
|
…titemindex when table prefix is used (OrchardCMS#3692)
My GraphQL query is
This is what the generated query looks like for postgresql(tp_ is the table prefix):
SELECT "tp_Document".* FROM "tp_Document" INNER JOIN "tp_ContentItemIndex" ON "tp_ContentItemIndex"."DocumentId" = "tp_Document"."Id" WHERE ("tp_ContentItemIndex"."Published" = $1) AND ("tp_ContentItemIndex"."ContentType" = $2) AND (("ContentItemIndex"."contentItemId" = $3)) ORDER BY "tp_ContentItemIndex"."CreatedUtc" DESC
Using
orderBy
clause on the same field work well so issue seems to be withwhere
clause only.There are two issues:
ContentItemIndex
table doesn't have the appropriate table prefix unlike rest of the items.contentItemId
retains the camelCasing instead of the PascalCased column name expected.I tried debugging the code and my suspicion is
src\OrchardCore\OrchardCore.ContentManagement.GraphQL\Queries\ContentItemsFieldType.cs
For # 1,
predicateQuery.CreateAlias("", nameof(ContentItemIndex));
seems to be the issue. We are not determining the right alias.For # 2, I think orderBy implements a switch statement which changes the case of the fields.
The text was updated successfully, but these errors were encountered: