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 Aliases on relational value #8402
Comments
Can confirm this bug is present, and seems like #8332 was correct in that aliases are broken since rc.94 (even though we couldn't replicate it back then). Managed to narrow it down to this bug being introduced in #8009's |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I managed to narrow it down to the line (api/src/services/graphql.ts) removing the part |
Wanna open a PR with that fix @filipproch? 🙂 |
@rijkvanzanten sure, would there be an appropriate place to also create a test case for future? |
Also one more edit is needed, both edits are required to make it work |
We've just started an effort to setup test cases for more and more bits of the API, but I don't think the GraphQL endpoint / services have something spun up yet, right @jaycammarano? |
No. That was on my notes to discuss. Was thinking of probably doing e2e for REST and integration for GraphQL? Just so there's not a ton of repetition in the e2e tests. |
Ok will send PR with just the fix then |
Unfortunately, this fix seems to have broken other things. Now aliases to simple fields return the error message "Cannot destructure property 'type' of 'field' as it is undefined," and aliases to many-to-one fields return null, which was the original problem I was seeing. I'm in version rc.99. |
@cdanny358 I will look into it further then and invent a better solution |
I can confirm this bug exists in RC100.
My code:
Should we reopen this one or open a new issue? |
A new issue would be most helpful @iksent 👍🏻 |
@iksent And feel free to mention me, I plan to submit a PR this week |
Awesome, thank you! |
Describe the Bug
When using alias in a graphqQL query on a junction table the returned value of the field using the alias is null. When I remove the alias from the query the data is there.
To Reproduce
What version of Directus are you using?
9.0.0-rc95
What version of Node.js are you using?
14.17.5
What database are you using?
Postgres 13.2
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying Directus?
Jelastic
The text was updated successfully, but these errors were encountered: