graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.62k stars 571 forks source link

Unclear error message thrown on non-valid orderBy (e.g. non-array) #1854

Open wesselvdv opened 1 year ago

wesselvdv commented 1 year ago

When this occurs you only get a single message: "Invalid!", quite difficult to track down where the issue is.

https://github.com/graphile/crystal/blob/818b0e619949a3e7a89fea16430f6b4e4bd726aa/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts#L238

Also, side note. Shouldn't null be a valid input? Or should it just be completely absent? It isn't a required input ofc.

EDIT:

I see that my above comment is only applicable to response, not request.

benjie commented 1 year ago

Yes, null should be a valid orderBy of dubious usefulness. Why would you pass null?! Anyway yes this needs fixing; it's on the list.