You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If name was defined first in the schema for SortFields, the objects returned will come back in the wrong order as that is what comes through “first” in the resulting query.
Is this something that could be changed in this library? Are we misunderstanding how this ordering works/should we be using a different approach to ensure the order of these sort fields is preserved?
Thanks!
The text was updated successfully, but these errors were encountered:
should we be using a different approach to ensure the order of these sort fields is preserved?
You can use array, but you probably will need to add some check to make sure that only one field passed (until @oneOf, #619). You can also check my package to see how we a doing it.
When
InputObjectType
values are parsed, they’re re-ordered to match the order they are set in the schema definition:graphql-php/src/Utils/Value.php
Lines 124 to 126 in d6c965e
We (Silverstripe framework) pass sort order args as input objects, e.g:
Query:
Variables:
If
name
was defined first in the schema forSortFields
, the objects returned will come back in the wrong order as that is what comes through “first” in the resulting query.Is this something that could be changed in this library? Are we misunderstanding how this ordering works/should we be using a different approach to ensure the order of these sort fields is preserved?
Thanks!
The text was updated successfully, but these errors were encountered: