graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

HC0052 pagination error message does not take into account AllowBackwardPagination

Open cmeeren opened this issue 1 year ago • 1 comments

Product

Hot Chocolate

Version

13.8.1

Link to minimal reproduction

See zip below

Steps to reproduce

Repro solution: HotChocolateBugRepro.zip

Code for reference:

public class Query
{
    [UsePaging(RequirePagingBoundaries = true, AllowBackwardPagination = false)]
    public IEnumerable<string> GetStrings() => [];
}

Query:

query {
  strings {
    nodes
  }
}

What is expected?

An error message saying You must provide a `first` value to properly paginate the `StringsConnection`.

What is actually happening?

An error message saying You must provide a `first` or `last` value to properly paginate the `StringsConnection`.

Relevant log output

No response

Additional context

No response

cmeeren avatar Feb 09 '24 10:02 cmeeren

Edge case: When using manual pagination (explicit first/after arguments), I guess AllowBackwardPagination does nothing, so in that case the message should be determined based on the presence or absence of the last argument.

cmeeren avatar Feb 09 '24 10:02 cmeeren

This is mistakenly labelled Area: F#. The repro code is C#.

cmeeren avatar May 15 '24 07:05 cmeeren