GraphQL HotChocolate 13: Adding PaginationAmountType to be backwards compatible for old clients

GraphQL HotChocolate 13: Adding PaginationAmountType to be backwards compatible for old clients


0

I’m migrating a quite old GraphQL server (<10) to the latest version (13). It looks everything is working OK after doing the necessary changes. The only thing is that HotChocolate dropped the PaginationAmountType class. The queries done by clients of my service do not seem to be compatible anymore.

As this is a critical service I really would like to be backwards compatible with the PaginationAmountType type. Is there a way to allow to use both the new Int type as well as the PaginationAmountType, until all clients have been upgraded?

(update: I found out about the LegacySupport option to use the original type, but I want to upgrade clients to the new system of course).

        .SetPagingOptions(new PagingOptions()
        {
            IncludeTotalCount = true,
            MaxPageSize = 100,
            LegacySupport = true,
        });

Example query:

query contacts($first:PaginationAmount,$where:ContactFilter) 
{
  contacts(first:$first,where:$where) 
  {
    totalCount
    edges 
    {
      node 
      {
        id
        firstName
        lastName
...


Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *