Fixing arguments order when getting value from AST #533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
Given the following
InputObjectType
:and something like
order: {bar: "ASC", foo: "ASC"}
as value, the return ofGraphQL\Utils\AST::valueFromAST
will be['foo' => 'ASC', 'bar' = 'ASC']
.However when the order of arguments has importance, like constructing an
ORDER
SQL clause, this can pose a problem and the return should be['bar' => 'ASC', 'foo' = 'ASC']
.The aim of this PR is to fix this by using the order given by the user instead of the order defining during the field configuration.
I used directly
assertSame()
in the test case instead of the helper methodrunTestCaseWithVars
because this method useassertEquals
and this doesn't test the order of the keys.Tell me if I should replace
assertEquals
byassertSame
in the helper method, I was not sure about that.fix : api-platform/core#2808