silverstripe / silverstripe-graphql

Serves Silverstripe data as GraphQL representations
BSD 3-Clause "New" or "Revised" License
52 stars 61 forks source link

GraphQL errors when passing sort parameters as separate variables #583

Closed priyashantha closed 3 months ago

priyashantha commented 3 months ago

Module version(s) affected

4.3 and above

Description

When the sort params are passed separately in variables a graphql error is triggered. When sort params are attached inside the query it works fine. There was no issue with "silverstripe/graphql" version 4.2.5. Issue happens on versions after that version i.e. 4.3., 5.

Screenshot 2024-05-08 at 1 11 37 PM

How to reproduce

Here is the query I'm using

query Pages($limit: Int, $sortBy: PageSortFields) {
  readPages(limit: $limit, sort: $sortBy) {
    edges {
      node {
        id
        title
      }
    }
  }
}

And the variables

{
    "sortBy": {
        "title": "DESC"
    }
}

Possible Solution

No response

Additional Context

No response

Validations

kinglozzer commented 3 months ago

Duplicate of https://github.com/silverstripe/silverstripe-graphql/issues/571