Skip to content

Connection does not have exposed Nodes #8377

@Prikalel

Description

@Prikalel

Product

Hot Chocolate

// latest versions of packages
<PackageReference Include="HotChocolate.Types.CursorPagination" Version="15.1.6" />
<PackageReference Include="HotChocolate.Types.OffsetPagination" Version="15.1.6" />

Is your feature request related to a problem?

While using Connecrtion with CursorPaging I cant get a connection' nodes for extending a generated connection type, etc :

public class MyTypeConnectionExtensions : ObjectTypeExtension
{
    /// <inheritdoc />
    protected override void Configure(IObjectTypeDescriptor descriptor)
    {
        descriptor.Name("MyTypeConnection");

        descriptor
            .Field("nodes") // for example I want to rename nodes to items
            .Type<ListType<ObjectType<MyType>>>()
            .Name("items")
            .Description("A flattened list of the nodes.")
            .Resolve(context =>
                context.Parent<Connection<MyType>>().Nodes); // this not work. Connection does not have a Nodes field
    }
}

The solution you'd like

Connection have field Edges, which (while using the code above) not alwayes populated with nodes and requires to selecting nodes from edges. Can we add a convenient way to rename default properies in connection/collectionsegments ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions