Even if a method receives several parameters, then sorting occurs by the field of the arguments that is last specified in the schema, and not in the passed parameters. That is, if SilverStripe\GraphQL\Tests\Fake\DataObjectFake has the following schema
fields:
myField: true
AuthorID: true
and sorting is required AuthorID => DESC, myField => ASC, then sorting was done only by AuthorID, since in the schema this field is indicated after myField.
Therefore, the call $list->sort() must be completed after all the necessary processing has been carried out.
Description
Even if a method receives several parameters, then sorting occurs by the field of the arguments that is last specified in the schema, and not in the passed parameters. That is, if
SilverStripe\GraphQL\Tests\Fake\DataObjectFake
has the following schemaand sorting is required
AuthorID => DESC, myField => ASC
, then sorting was done only byAuthorID
, since in the schema this field is indicated after myField. Therefore, the call$list->sort()
must be completed after all the necessary processing has been carried out.Parent issue