Skip to content

experiment: lazily create DeferredFragments#4150

Closed
yaacovCR wants to merge 9 commits intographql:mainfrom
yaacovCR:lazy-create
Closed

experiment: lazily create DeferredFragments#4150
yaacovCR wants to merge 9 commits intographql:mainfrom
yaacovCR:lazy-create

Conversation

@yaacovCR
Copy link
Copy Markdown
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
@netlify
Copy link
Copy Markdown

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.

@github-actions
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@yaacovCR
Copy link
Copy Markdown
Contributor Author

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

@yaacovCR yaacovCR closed this Jul 24, 2024
@yaacovCR yaacovCR deleted the lazy-create branch July 24, 2024 18:23
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