Skip to content

Alias is not working on "wrapper" fields #5584

@Andy2003

Description

@Andy2003

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmedConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions