-
Notifications
You must be signed in to change notification settings - Fork 149
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
Alias is not working on "wrapper" fields #5584
Comments
It seems to be a typing issue on my side, your test is valid and it is working as expected! |
But if you adjust the query to be even more fancy: you will get an error: query {
${Movie.plural}(where: { title: "The Matrix" }) {
title1: title
actorsConnection1: actorsConnection(where: { node: { name: "Keanu Reeves" } }) {
edges1: edges {
node1: node {
nameA1: name
A1: moviesConnection(where: { node: { title: "Foo" } }) {
edges2: edges {
node2: node {
title2: title
a: actors {
name2: name
}
}
}
}
}
}
edges2: edges {
node1: node {
nameA2: name
A2: moviesConnection(where: { node: { title: "The Matrix" } }) {
edges2: edges {
node2: node {
title2: title
a: actors {
name2: name
}
}
}
}
}
}
}
}
}
|
I was miss-leaded by the generated cypher. There is this fallback
But this does not work in the code I provided in the previous comment |
We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @Andy2003! 🙏 We will now prioritise the bug and address it appropriately. |
After tinkering a bit with this. The problem is caused by the translation not applying the edge alias, meaning that it only generates 1 set of edges instead of 2. This can be replicated with a simpler query: query {
movies(where: { title: "The Matrix" }) {
title1: title
actorsConnection1: actorsConnection(where: { node: { name: "Keanu Reeves" } }) {
edges1: edges {
node1: node {
nameA1: name
}
}
edges2: edges {
node1: node {
nameA2: name
}
}
}
}
} |
Its not possible to add an alias to each level of the projection.
Type definitions
To Reproduce
Run the query
Error: Cannot read properties of undefined (reading 'edges')
Additional context
Aliases are currently not supported at "wrapper" fields. I think this is a low priority bug, but since the grapqhl spec allows aliases on each field, we should support these cases as well.
The text was updated successfully, but these errors were encountered: