-
-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken type helper (GetPgResourceRelations) #1755
Comments
Seems it's not entirely the fault of these type helpers. Seems I made some mistakes trying to make it fit into the existing PgRegistry which has type parameters that are narrowing too much. |
Alright, looks like the issue is narrowing too much in the type parameters of PgRegistry. Causing typescript to get a union of |
I found when using inference that TypeScript would quickly resort to |
If you're interested; here is where I used to use the inferrence: https://github.com/graphile/crystal/blame/cf0090f3261df3035853e5bd4e15e174987997a5/grafast/dataplan-pg/src/interfaces.ts#L806 |
Summary
Various type helpers appear to be broken (
GetPgResourceRelations
) for example always returnsany
even when supplying a fully typedPgResource
with explicit relations. I would advice to useinfer
instead of property access to prevent type erasure.Below works:
Whereas this doesnt:
The text was updated successfully, but these errors were encountered: