Skip to content
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

fix(types): overrideTypes work on invalid embeded relation #606

Merged
merged 4 commits into from
Feb 24, 2025

Conversation

avallete
Copy link
Member

@avallete avallete commented Feb 21, 2025

  • When a relation doesn't exist, or that type inference fail to resolve it the new type should be the source of truth for the result. In such case, we don't "merge" the properties together, but just replace the error with the user provided type.
  • When chaining the override with .maybeSingle preserve the optionality of the result
  • Allow merging between literal object and non literal one eg:
// Given some property like
{
   someProperty: Record<string, Json | null>
}
// calling
overrideType<{ someProperty: { literalProperty: string }  }>()
// result in:
{
    [key: string]: Json | null
    someProperty: { literalProperty: string }
} 

When a relation doesn't exist, or that type inference fail to resolve it
the new type should be the source of truth for the result
@avallete avallete force-pushed the avallete/fix-override-on-invalid-relations branch from 8e0a0fc to 29e8c96 Compare February 23, 2025 16:14
@avallete avallete merged commit 1f93ee5 into master Feb 24, 2025
2 checks passed
Copy link

🎉 This PR is included in version 1.19.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants