@graphql-codegen/cli 2.4.0 → 2.4.1-alpha-5081829d6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin.js CHANGED
@@ -978,10 +978,13 @@ async function executeCodegen(input) {
978
978
  title: 'Load GraphQL documents',
979
979
  task: wrapTask(async () => {
980
980
  debugLog(`[CLI] Loading Documents`);
981
- const allDocuments = [...rootDocuments, ...outputSpecificDocuments];
982
- const hash = JSON.stringify(allDocuments);
983
- const result = await documentsLoadingCache.load(hash);
984
- const documents = result.documents;
981
+ // get different cache for shared docs and output specific docs
982
+ const results = await Promise.all([rootDocuments, outputSpecificDocuments].map(docs => {
983
+ const hash = JSON.stringify(docs);
984
+ return documentsLoadingCache.load(hash);
985
+ }));
986
+ const documents = [];
987
+ results.forEach(source => documents.push(...source.documents));
985
988
  if (documents.length > 0) {
986
989
  outputDocuments.push(...documents);
987
990
  }
package/index.js CHANGED
@@ -896,10 +896,13 @@ async function executeCodegen(input) {
896
896
  title: 'Load GraphQL documents',
897
897
  task: wrapTask(async () => {
898
898
  debugLog(`[CLI] Loading Documents`);
899
- const allDocuments = [...rootDocuments, ...outputSpecificDocuments];
900
- const hash = JSON.stringify(allDocuments);
901
- const result = await documentsLoadingCache.load(hash);
902
- const documents = result.documents;
899
+ // get different cache for shared docs and output specific docs
900
+ const results = await Promise.all([rootDocuments, outputSpecificDocuments].map(docs => {
901
+ const hash = JSON.stringify(docs);
902
+ return documentsLoadingCache.load(hash);
903
+ }));
904
+ const documents = [];
905
+ results.forEach(source => documents.push(...source.documents));
903
906
  if (documents.length > 0) {
904
907
  outputDocuments.push(...documents);
905
908
  }
package/index.mjs CHANGED
@@ -869,10 +869,13 @@ async function executeCodegen(input) {
869
869
  title: 'Load GraphQL documents',
870
870
  task: wrapTask(async () => {
871
871
  debugLog(`[CLI] Loading Documents`);
872
- const allDocuments = [...rootDocuments, ...outputSpecificDocuments];
873
- const hash = JSON.stringify(allDocuments);
874
- const result = await documentsLoadingCache.load(hash);
875
- const documents = result.documents;
872
+ // get different cache for shared docs and output specific docs
873
+ const results = await Promise.all([rootDocuments, outputSpecificDocuments].map(docs => {
874
+ const hash = JSON.stringify(docs);
875
+ return documentsLoadingCache.load(hash);
876
+ }));
877
+ const documents = [];
878
+ results.forEach(source => documents.push(...source.documents));
876
879
  if (documents.length > 0) {
877
880
  outputDocuments.push(...documents);
878
881
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/cli",
3
- "version": "2.4.0",
3
+ "version": "2.4.1-alpha-5081829d6.0",
4
4
  "peerDependencies": {
5
5
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
6
6
  },