Closed vhfmag closed 2 weeks ago
Latest commit: 049b7224d4a666132e63f84c64c413a8cfe7f899
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Description
As mentioned in https://github.com/dotansimha/graphql-code-generator/issues/10018,
ClientSideBaseVisitor
'sfragmentsGraph
is implemented as a getter, despite not depending on anything that changes after the class is first instantiated. TurningfragmentsGraph
into a static property improved build time from ~130s to ~50s in a big monorepo.This PR does that and it makes field
fragmentsGraph
depends on (_fragments
) read-only to make sure we don't break the assumption behind pre-computing the former.Related: #10018
Type of change
Please delete options that are not relevant.
Screenshots/Sandbox (if appropriate/relevant):
Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate
How Has This Been Tested?
client-preset
and measure the build timefragmentsGraph
once perClientSideBaseVisitor
instanceTest Environment:
graphql
version: 16.2.0@graphql-codegen/client-preset
version(s): 4.2.6@graphql-codegen/visitor-plugin-common
version(s): 2.13.1Checklist:
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...