supabase / pg_graphql

GraphQL support for PostgreSQL
https://supabase.github.io/pg_graphql
Apache License 2.0
2.88k stars 101 forks source link

Order of response fields don't match the query order. #538

Closed GaryAustin1 closed 2 months ago

GaryAustin1 commented 2 months ago

Describe the bug A user in Discord is reporting a potential issue with the return order of fields. Because of the spam filters here he can't post an issue yet. I'm passing this on without knowledge of GraphQL but do see references online to order being guaranteed by the spec.

https://discord.com/channels/839993398554656828/1257899880274202706 image

olirice commented 2 months ago

The user reached out on reddit https://www.reddit.com/r/Supabase/comments/1du3ylm/comment/lbggu3s/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

as far as I can tell there is no guarantee in the spec that request order dictates the response order.

We could accomplish that by using json instead of jsonb, but json is meaningfully less performant.

The order only matters for human inspection, which accounts for a small fraction of requests.

Since it isn't part of the spec (please correct me if wrong) and would result in a performance hit, we likely will not act on this

GaryAustin1 commented 2 months ago

I would agree if it is not part of the spec then it should not be implemented. But as I said I was just passing on his post as he could not last night and I don't know graphQL.

olirice commented 2 months ago

Thanks, going to close it here

For anyone who ends up here please see the linked reddit thread for more info