-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@@ -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> { |
There was a problem hiding this comment.
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 HydratedDocument
s so much with any additional properties that we tack on after fetching the record from the DB.
There was a problem hiding this 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
#187