-
-
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
Auto-resolve unresolved aliased fields #283
Conversation
please consider adding a |
👍 added in b7ec923 ! |
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.
Change LGTM too 👍
I'm not sure how to test this properly
Please allow me a bit time to figure this before merging, will get back ASAP!
Should we have a check that this new resolver only applies when there is a model defined? |
Label as blocked until #289 can land, after which we can cover the change with a test |
In #289 I've now added the test |
Yup. |
After #283 landed, this is now fixed and correctly resolves the alias field.
Thanks for the PR! I've merged this into master and also the recent v1 branch and cut a new v1.22.0 release (hopefully it works 🤞 as expected).
There does not seem to be a technical reason for this yet. For simple attribute aliases it seems the model is not required. Without it, the generated SQL query will simple not use qualified names. I.e. the difference will be:
But nevertheless it will work correctly; as the SelectFields in general does. |
Thank you @mfn |
Future fix prepared in rebing/graphql-laravel#283
After rebing/graphql-laravel#283 landed, this is now fixed and correctly resolves the alias field.
Adds simple default resolver to aliased fields when no resolver is present.
I'm not sure how to test this properly ( please comment )
#280