SeedCompany / cord-api-v3

Bible translation project management API
MIT License
18 stars 4 forks source link

New way to merge interfaces that's variadic and DRY for TS & GQL #3234

Closed CarsonF closed 1 month ago

CarsonF commented 1 month ago

I held off on this because TS doesn't natively support variadic generic parameters, so the conventional workaround is to add overloads for 1-10ish parameters before giving up.

But what we do right now is so clunky and we need up enumerating each interface 3 times. So I bit the bullet. The type code is long, but cleans up the business logic nicely.

I also moved the remaining secured enum wrappers to their respective files. Most were already there, but there were some stragglers.

github-actions[bot] commented 1 month ago

🗞 GraphQL Summary

View schema changes ```diff @@ -5394,9 +5394,9 @@ value: File } """ -An object with partnership funding type `value` and additional authorization information. +An object with financial reporting type `value` and additional authorization information. The value is only given if `canRead` is `true` otherwise it is `null`. These `can*` authorization properties are specific to the user making the request. """ type SecuredFinancialReportingType implements Secured { ```