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

Confusing errors when referencing wrong type name in makeExtendSchemaPlugin #2217

Open p-bakker opened 1 month ago

p-bakker commented 1 month ago

Summary

If referencing a non-existing type in a makeExtendSchemaPlugin plugin that targets just one entity, this results in a cascade of exceptions on every subsequent entity

Steps to reproduce

See https://discord.com/channels/489127045289476126/1296863704364879902/1297218564876406947

Expected results

Only 1 exception on the affected entities

Actual results

Exceptions on all subsequent entities

Additional context

\ (https://discord.com/channels/489127045289476126/1296863704364879902/1297218564876406947)

Possible Solution

benjie commented 1 month ago

(Reminder to self: the issue was referencing Metadata when the type name was Metadatum. Caused extend plugin to blow up the entire Query type, which then went on to blow up mutation payload types.)