-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Select * is preventing from groupping by for Interface types #683
Comments
Maybe the problem is this graphql-laravel/src/Support/SelectFields.php Line 256 in 19ea3ed
|
I think it's just a part of a larger problem. Each Interface or Union should assume that every field defined in it are available in the database, but should use the alias and query defined in the type implementing the Interface or Union. I have been working on it with the method graphql-laravel/src/Support/SelectFields.php Line 449 in 19ea3ed
But it does not support aliases. (apparently) |
Great! May the force be with you :) |
Added the |
I am taking a look at this, it seems that relationships are not working well either... |
Tried to tackle this by using webonyx QueryPlan helper, which could ease this problem quite a bit, but since it still have unresolved issues, like this: webonyx/graphql-php#831, It will have to wait for now |
Does https://github.com/nuwave/lighthouse support? Not sure, might be worth checking out how they do it. |
Versions:
Description:
The generated SQL for a group by on an interface would raise an error as * is selected instead of the group by fields
Steps To Reproduce:
With this kind of configuration, the SQL request would result in:
And of course, it would raise an SQL error:
Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ...
Expectations
Only the required fields should be selected
The text was updated successfully, but these errors were encountered: