graphql
graphql copied to clipboard
Alias is not working on "wrapper" fields
Its not possible to add an alias to each level of the projection.
Type definitions
type Movie {
title: String!
actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN)
}
type Actor {
name: String!
movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT)
}
type ActedIn @relationshipProperties {
screenTime: Int!
}
To Reproduce
Run the query
{
movies(where: { title: "The Matrix" }) {
title1: title
actorsConnection1: actorsConnection(where: { node: { name: "Keanu Reeves" } }) {
edges1: edges {
properties1: properties {
screenTime1: screenTime
}
node1: node {
name1: name
b: moviesConnection(where: { node: { title: "The Matrix"}}) {
edges2: edges {
node2: node {
title2: title
a: actors {
name2: name
}
}
}
}
}
}
}
}
}
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.