graphile / crystal-pre-merge

Repository moved
https://github.com/graphile/crystal
39 stars 8 forks source link

Improve error message for duplicate resource name #451

Closed benjie closed 1 year ago

benjie commented 1 year ago

Fixes #447

I've just bought the new domain err.red (errored) to use as short links in Graphile's projects. I've set https://err.red/p* to redirect to https://postgraphile.org/postgraphile/next/errors/$1, so now we can add error pages to the PostGraphile documentation and then link them from the error messages themselves. I wanted to do this to give more detail on the Attempted to add a second resource named ... error that @dmfay reported... But in writing the documentation for this error, I realised that we didn't even tell people what a "resource" was in the PostGraphile documentation - you have to go into the @dataplan/pg docs for that. So I've rectified this by adding a "registry" page to the documentation that explains what the parts of the registry are, and I've also changed the @dataplan/pg docs so that these different methods are hyperlinkable.

Oh... and I fixed that we were outputting [object Object] in an error message.