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

perf(@nestjs/graphql): make it faster to construct a typescript file from GraphQL schema #2081

Merged
merged 3 commits into from Jul 20, 2022

Conversation

katainaka0503
Copy link
Contributor

@katainaka0503 katainaka0503 commented Mar 13, 2022

Use ts-morph's structure for typescript file construction.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)
    • Use ts-morph 's Structure to construct ts file, which improves time to construct a typescript file from schema. This makes it faster to construct a typescript file from GraphQL schema from 40s to ~3s in my environment.

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Both are in my environment.

before

スクリーンショット 2022-03-21 11 34 45

after

スクリーンショット 2022-03-21 11 31 20

@katainaka0503 katainaka0503 changed the title perf(@nestjs/graphql): improve time to create construct to file perf(@nestjs/graphql): improve time to construct ts file Mar 13, 2022
Use structure for ts file construction
@katainaka0503 katainaka0503 changed the title perf(@nestjs/graphql): improve time to construct ts file perf(@nestjs/graphql): improve time to construct typescript file from GraphQL schema Mar 18, 2022
@katainaka0503 katainaka0503 changed the title perf(@nestjs/graphql): improve time to construct typescript file from GraphQL schema perf(@nestjs/graphql): make it faster to construct typescript file from GraphQL schema Mar 18, 2022
@katainaka0503 katainaka0503 changed the title perf(@nestjs/graphql): make it faster to construct typescript file from GraphQL schema perf(@nestjs/graphql): make it faster to construct a typescript file from GraphQL schema Mar 18, 2022
Construct all the contents of the generated typescript file by structure
@@ -7,6 +7,7 @@

/* tslint:disable */
/* eslint-disable */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR slightly changes output file about blank lines

@katainaka0503
Copy link
Contributor Author

@kamilmysliwiec Hi! Is there anything I can help you review this PR?

@kamilmysliwiec
Copy link
Member

lgtm

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

Successfully merging this pull request may close these issues.

None yet

2 participants