aquadoggo icon indicating copy to clipboard operation
aquadoggo copied to clipboard

Don't make GraphQL ordering enum values lowercase

Open sandreae opened this issue 1 year ago • 2 comments

When we generate ordering input enums for the GraphQL query API we make field keys lowercase. This was to avoid collisions with the default values like DOCUMENT_ID etc... but i wonder if we want to do this as field names can contain capital letters....

https://github.com/p2panda/aquadoggo/blob/1dc1420b95399c10741f5178df19491dbb2152e4/aquadoggo/src/graphql/types/ordering.rs#L42

sandreae avatar Apr 19 '23 14:04 sandreae

I thought it is enough to distinct if the value is an enum or string type? Or is this not how GraphQL works?

adzialocha avatar Apr 19 '23 20:04 adzialocha

I think it will require changing the backing data types, currently the field keys are added as new items to the enum.

https://github.com/p2panda/aquadoggo/blob/1dc1420b95399c10741f5178df19491dbb2152e4/aquadoggo/src/graphql/types/ordering.rs#L38-L43

We just need to do this a little differently then it'll be fine.

sandreae avatar Apr 20 '23 11:04 sandreae