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

Add return explicit return type to toJSON #133

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

scott-rc
Copy link
Contributor

This adds an explicit return type to our toJSON methods instead of the inferred any type.

PR Checklist

  • Important or complicated code is tested
  • Any user facing changes are documented in the Gadget-side changelog
  • Any immediate changes are slated for release in Gadget via a generated package dependency bump
  • Versions within this monorepo are matching and there's a valid upgrade path

@scott-rc scott-rc force-pushed the scott-rc/to-json-return-type branch 3 times, most recently from 62acad2 to 75099fb Compare December 1, 2022 21:42
@@ -220,7 +220,7 @@ export class InternalModelManager {
const response = await this.connection.currentClient.query(internalFindOneQuery(this.apiIdentifier), { id }).toPromise();
const assertSuccess = throwOnEmptyData ? assertOperationSuccess : assertNullableOperationSuccess;
const result = assertSuccess(response, ["internal", this.apiIdentifier]);
return await hydrateRecord(response, result);
return hydrateRecord(response, result);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ESLint started complaining about these awaits after I added those return types 😕

@airhorns airhorns marked this pull request as ready for review March 30, 2023 16:13
@airhorns airhorns merged commit af73b1d into main Mar 30, 2023
@airhorns airhorns deleted the scott-rc/to-json-return-type branch March 30, 2023 16:28
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