ChilliCream / ChilliCream/graphql-platform

Connection does not have exposed Nodes

Open
#8,377 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Data
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing this with HotChocolate.Types.CursorPagination and HotChocolate.Types.OffsetPagination 15.1.6, then inspect the generated MyTypeConnection and Connection behavior around nodes and Edges. Confirm the expected configuration for renaming connection or collection-segment properties and add coverage showing that the renamed field resolves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.