Skip to content

experiment: lazily create DeferredFragments #4150

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

Closed
wants to merge 9 commits into from

Conversation

yaacovCR
Copy link
Contributor

goal:

avoid creating or passing around the deferMap

methodology:

  • each DeferredFragmentRecord will be unique for a given deferUsage and creationPath
  • we annotate the path and deferUsage with a "fieldDepth" property representing the number of nested fields in the operation corresponding to the current execution path and the defer directive.
  • from a path for a deferredGroupedFieldSet, we can derive the path for the deferredFragment from a given deferUsage by "rewinding" the deferredGroupedFieldSet path to the depth of the given deferUsage
  • we also add a "fieldDepth" property to the FieldDetails structure as well so as to not require an additional depth argument to collectFields which would complicate memoization

goal:

avoid creating or passing around the deferMap

methodology:

- each DeferredFragmentRecord will be unique for a given deferUsage and creationPath
- we annotate the path and deferUsage with a "fieldDepth" property representing the number of nested fields in the operation corresponding to the current execution path and the defer directive.
- from a path for a deferredGroupedFieldSet, we can derive the path for the deferredFragment from a given deferUsage by "rewinding" the deferredGroupedFieldSet path to the depth of the given deferUsage
- we also add a "fieldDepth" property to the FieldDetails structure as well so as to not require an additional depth argument to collectFields which would complicate memoization
@yaacovCR yaacovCR requested a review from a team as a code owner July 22, 2024 15:00
Copy link

netlify bot commented Jul 22, 2024

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit b4bc441
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/669fc5bc672d1b00081cba51
😎 Deploy Preview https://deploy-preview-4150--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
Copy link
Contributor Author

not sure this is worth it -- but it works!!

@yaacovCR
Copy link
Contributor Author

closing this for now as best to not modify Path, but we can always revisit

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