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

Bug fixes for TypeScript refactor #236

Merged
merged 17 commits into from
Aug 8, 2024
Merged

Conversation

nathanielrindlaub
Copy link
Member

@@ -181,14 +181,14 @@ export class ImageModel {
static async createImage(
input: gql.CreateImageInput,
context: Pick<Context, 'user'>,
): Promise<HydratedDocument<ImageAttemptSchema> & { errs?: ImageErrorSchema[] }> {
): Promise<gql.ImageAttempt> {
Copy link
Member Author

@nathanielrindlaub nathanielrindlaub Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be preferable to return GraphQL codegen-generated types in more model methods because (a) we don't need all the properties and methods that a Mongoose HydratedDocument contains and (b) we also won't have to extend the HydratedDocuments so much with any additional properties that we tack on after fetching the record from the DB.

src/@types/graphql.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Copy link
Contributor

@jue-henry jue-henry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me and testing on staging seems fine

@nathanielrindlaub nathanielrindlaub merged commit 9400a6c into main Aug 8, 2024
2 checks passed
@nathanielrindlaub nathanielrindlaub deleted the ts-refactor-cleanup branch August 8, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants