Skip to content

Likely copy/paste error found in HotChocolate.Types.UsePagingAttribute #4815

Closed

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Just familiarizing myself with the codebase and ran across what's likely a copy / paste error, given there are default values for the mis-mapped fields in HotChocolate.Types.Pagination.PagingDefaults.

    /// <summary>
    /// Allow backward paging using <c>last</c> and <c>before</c>
    /// </summary>
    public bool AllowBackwardPagination
    {
        get => _allowBackwardPagination ?? PagingDefaults.AllowBackwardPagination;
        set => _allowBackwardPagination = value;
    }

    /// <summary>
    /// Defines if the paging middleware shall require the
    /// API consumer to specify paging boundaries.
    /// </summary>
    public bool RequirePagingBoundaries
    {
        get => _requirePagingBoundaries ?? PagingDefaults.AllowBackwardPagination;
        set => _requirePagingBoundaries = value;
    }

    /// <summary>
    /// Connection names are by default inferred from the field name to
    /// which they are bound to as opposed to the node type name.
    /// </summary>
    public bool InferConnectionNameFromField
    {
        get => _inferConnectionNameFromField ?? PagingDefaults.AllowBackwardPagination;
        set => _inferConnectionNameFromField = value;
    }

The 2nd and 3rd properties listed above are all mapped to the default for AllowBackwardPagination if no override is supplied.

Steps to reproduce

  1. Visit https://github.com/ChilliCream/hotchocolate/blob/c479c10343f22328f708dc4d8e80f98a76bbf518/src/HotChocolate/Core/src/Types.CursorPagination/Extensions/UsePagingAttribute.cs

Relevant log output

No response

Additional Context?

No response

Product

Hot Chocolate

Version

12 (HEAD of repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: DataIssue is related to filtering, sorting, pagination or projections🌶️ hot chocolate🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions