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

refactor(stitchingInfo): shift more calculation to build time #3199

Merged
merged 1 commit into from Jul 13, 2021

Conversation

yaacovCR
Copy link
Collaborator

-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a Set (rather than by printing nodes and using a Map)

-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a set
@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2021

⚠️ No Changeset found

Latest commit: fc7a73f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@theguild-bot
Copy link
Collaborator

theguild-bot commented Jul 13, 2021

The latest changes of this PR are not available as alpha, since there are no linked changesets for this PR.

@yaacovCR yaacovCR merged commit bcdbba3 into master Jul 13, 2021
@yaacovCR yaacovCR deleted the consolidate-selection-sets branch July 13, 2021 19:16
ardatan pushed a commit that referenced this pull request Jul 25, 2021
-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a Set
ardatan pushed a commit that referenced this pull request Jul 25, 2021
-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a Set
ardatan added a commit that referenced this pull request Jul 26, 2021
No need for deepMerge

use createDefaultExecutor

Few improvements

workflow_dispatch

Not only master

refactor(stitchingInfo): shift more calculation to build time (#3199)

-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a Set

Use collectFields and ExecutionContext from graphql-js (#3200)

refactor: use Set to avoid repetition (#3202)

* use Set to deduplicate

* further refactor

refactor ExpandAbstractTypes as PrepareGatewayRequest

will consolidate remaining pre-user supplied transforms into this transform to hopefully reduce repetition

also adds memoization of schema metadata

small refactors

add visitorKeys argument

small refactor

import WrapConcreteFields into PrepareGatewayRequest

this does not use the same visitors and does not visit beneath fields, so can just be inlined

info should be optional in DelegationContext

fix types

Consolidate VisitSelectionSets

rename var

internalize PrepareGatewayDocument as transform

as prepareGatewayDocument function

move varName generator out of loop

to prevent recurrent looping

refactor AddArgumentsAsVariables

rename AddArgumentsAsVariables

to FinalizeGatewayRequest to consolidate post custom transforms

arguments should be added to target final targetSchema

not transformedSchema

move FilterToSchema tests to delegate package

starting refacotr of FilterToSchema

add visitorArgs

also -- unfortunately -- requires another visit pass to properly remove variables if an object or interface field does not have selections -- another approach could be to keep track of variable uses, and subtract at the end of the first pass

integrate FilterToSchema into FinalizeGatewayRequest

fold AddTypenameToAbstract into FinalizeGatewayRequest

extract finalizeGatewayRequest function from the transform

retire all delegation transforms

fix build

typo

Experiment LRU Cache

More promise

LRU with Refactor

Fix TS Build

Try

Print instead

More cache

Use JSON.stringify?

Fix caching
ardatan added a commit that referenced this pull request Jul 26, 2021
* Experiment LRU Cache

No need for deepMerge

use createDefaultExecutor

Few improvements

workflow_dispatch

Not only master

refactor(stitchingInfo): shift more calculation to build time (#3199)

-- run collectFields on selectionSet hints at build time
-- use a fieldNode cache at build time so that at run time we can collect unique fieldNodes simply by using a Set

Use collectFields and ExecutionContext from graphql-js (#3200)

refactor: use Set to avoid repetition (#3202)

* use Set to deduplicate

* further refactor

refactor ExpandAbstractTypes as PrepareGatewayRequest

will consolidate remaining pre-user supplied transforms into this transform to hopefully reduce repetition

also adds memoization of schema metadata

small refactors

add visitorKeys argument

small refactor

import WrapConcreteFields into PrepareGatewayRequest

this does not use the same visitors and does not visit beneath fields, so can just be inlined

info should be optional in DelegationContext

fix types

Consolidate VisitSelectionSets

rename var

internalize PrepareGatewayDocument as transform

as prepareGatewayDocument function

move varName generator out of loop

to prevent recurrent looping

refactor AddArgumentsAsVariables

rename AddArgumentsAsVariables

to FinalizeGatewayRequest to consolidate post custom transforms

arguments should be added to target final targetSchema

not transformedSchema

move FilterToSchema tests to delegate package

starting refacotr of FilterToSchema

add visitorArgs

also -- unfortunately -- requires another visit pass to properly remove variables if an object or interface field does not have selections -- another approach could be to keep track of variable uses, and subtract at the end of the first pass

integrate FilterToSchema into FinalizeGatewayRequest

fold AddTypenameToAbstract into FinalizeGatewayRequest

extract finalizeGatewayRequest function from the transform

retire all delegation transforms

fix build

typo

Experiment LRU Cache

More promise

LRU with Refactor

Fix TS Build

Try

Print instead

More cache

Use JSON.stringify?

Fix caching

* Fix mergeExtensions

* Fix benchmark

* More

* Fix tests

* Remove schemaTransforms

* More fixes

* Fix

* More improvements

* More improvements

* More fixes?

* Refactor w/o caching

* Try sth

* Reduce number of iterations

* Reduce number of iterations

* Small

* Fix build

* Cleanup

* Add changeset

* Fix build

* Fix tests
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.

None yet

2 participants