Skip to content

Parser too strict on ordering after frozen lists #83

@chadwhitely

Description

@chadwhitely

When parsing a query, the parser adheres to the original order, even in places where order shouldn't matter (arguments). This causes the two below queries to be marked as inequal by the comparator. Recommendation would be to sort any nodes for places where order doesn't matter, as part of optional_many.

We previously got around this issue by sorting the AST ourselves, but with the introduction of FrozenList, this now results in errors.

E       AssertionError: queryA =
E       {
E         vehicle(id: 3, otherId: 2) {
E           version
E           cancel
E           appointment {
E             when
E             afterDate
E           }
E           trigger {
E             how
E             Phase
E             PhaseOption
E             PhaseDelaySecs
E           }
E         }
E       }
E       
E        queryB =
E       {
E         vehicle(otherId: 2, id: 3) {
E           version
E           cancel
E           appointment {
E             when
E             afterDate
E           }
E           trigger {
E             how
E             Phase
E             PhaseOption
E             PhaseDelaySecs
E           }
E         }
E       }

Metadata

Metadata

Assignees

Labels

discussionNeeds more discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions