Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter ordering after formatting #70

Open
rpgreen-vendia opened this issue Feb 17, 2023 · 0 comments
Open

Parameter ordering after formatting #70

rpgreen-vendia opened this issue Feb 17, 2023 · 0 comments

Comments

@rpgreen-vendia
Copy link

rpgreen-vendia commented Feb 17, 2023

Hello,
What is the expected ordering of parameters after parsing and formatting?
The result I am seeing is somewhat unexpected - nested object keys are sorted alphanumerically but top-level parameters are not. Is this expected and can it be relied on to be deterministic? Thanks

let s = parse_query::<String>(r#"mutation m {doFoo(c: 3, b: 2, d: 3, a: {z: 1, y: 2, x: 3 }, f: [{c: 3, b: 2, a:1}] ){error}}"#).unwrap().to_string();
println!("{}", s);

Outputs:

mutation m {
  doFoo(c: 3, b: 2, d: 3, a: {x: 3, y: 2, z: 1}, f: [{a: 1, b: 2, c: 3}]) {
    error
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant