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

introduces mapSchemaConfig utility function #4297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Nov 19, 2024

motivation:

  1. rebuilds lexicographicallySortSchema on this generic utility, better demonstrating only the sorting
  2. rebuilds extendSchemaImpl on this utility
  3. can be used as base to more easily enhance extendSchema/buildASTSchema/buildSchema to take resolvers, etc
  4. can be used to expose a generic safe mapSchema utility

TO DO: improve test coverage

@yaacovCR yaacovCR requested a review from a team as a code owner November 19, 2024 11:23
Copy link

netlify bot commented Nov 19, 2024

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit f6325d3
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/673fa791e2839a00084138be
😎 Deploy Preview https://deploy-preview-4297--compassionate-pike-271cb3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR yaacovCR changed the title introduces mapSchema function introduces mapSchemaConfig function Nov 19, 2024
@yaacovCR
Copy link
Contributor Author

note: diff is easier to scan when hiding whitespace

@yaacovCR yaacovCR changed the title introduces mapSchemaConfig function introduces mapSchemaConfig utility function Nov 19, 2024
extracting this from lexicographicallySortSchema
and extendSchemaImpl

motivation:
1. to use to further enhance extendSchema/buildASTSchema/buildSchema to take resolvers, etc, and
2. to expose a generic safe mapSchemaConfig
@yaacovCR
Copy link
Contributor Author

yaacovCR commented Nov 21, 2024

This re-implementation brings a 24% performance boost to buildSchema() and a small drop in memory use.

image

I'm not sure yet what exactly brings the performance boost, I was just hoping for parity.

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.

1 participant