-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
allow adding columns in query field #806
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my inline feedback, this is a BC break.
I can see the argument for your use case, but then we break the others and there's no "right or wrong" here. We currently support the one case and afterwards only the other.
Basically for this to work, we would need to keep the current 'query'
and add another one, invoked afterwards.
Interestingly, now that your #799 is merged, you could extend SelectFields
, override getSelectableFieldsAndRelations
and make any logic you want…
What do you think? How do you want to proceed here? I can't merge "as is" as I don't see a good argument made for changing/dropping the existing behavuour.
Hi mfn. |
2ce5271
to
6994c82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks more elegant, but technically it's still change of behaviour…
Test coverage LGTM and I also can't think of case were this actually would break.
Are we sure we've no concerns here? Or should be rather wait for a major version bump?
We would also need a good / explanatory changelog for that one, so ppl understand the impact of the change.
WDYT?
could add it to this example: https://github.com/rebing/graphql-laravel#type-relationship-query I personally dont think this can cause any errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could add it to this example
Ok, let's do this. Yes, please add it :)
6994c82
to
f179c61
Compare
f179c61
to
1bc3d24
Compare
added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Summary
Allow adding columns in query closure. Fixes: #875
People might be using addSelect() in their model relationship or have a need to ad an extra column to a query direcly in the custom query.
Type of change:
Checklist:
composer fix-style