@graphql-codegen/plugin-helpers 5.0.4 → 5.0.5-alpha-20240819192335-fa24f331c724b37a46cb22bbdd65aee967c15842

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/cjs/federation.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApolloFederation = exports.removeFederation = exports.addFederationReferencesToSchema = exports.federationSpec = void 0;
3
+ exports.ApolloFederation = exports.federationSpec = void 0;
4
+ exports.addFederationReferencesToSchema = addFederationReferencesToSchema;
5
+ exports.removeFederation = removeFederation;
4
6
  const tslib_1 = require("tslib");
5
7
  const utils_1 = require("@graphql-tools/utils");
6
8
  const graphql_1 = require("graphql");
@@ -39,7 +41,6 @@ function addFederationReferencesToSchema(schema) {
39
41
  },
40
42
  });
41
43
  }
42
- exports.addFederationReferencesToSchema = addFederationReferencesToSchema;
43
44
  /**
44
45
  * Removes Federation Spec from GraphQL Schema
45
46
  * @param schema
@@ -68,7 +69,6 @@ function removeFederation(schema) {
68
69
  },
69
70
  });
70
71
  }
71
- exports.removeFederation = removeFederation;
72
72
  const resolveReferenceFieldName = '__resolveReference';
73
73
  class ApolloFederation {
74
74
  constructor({ enabled, schema }) {
package/cjs/helpers.js CHANGED
@@ -1,16 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isUsingTypes = exports.hasNullableTypeRecursively = exports.normalizeConfig = exports.normalizeInstanceOrArray = exports.normalizeOutputParam = exports.isConfiguredOutput = exports.isOutputConfigArray = void 0;
3
+ exports.isOutputConfigArray = isOutputConfigArray;
4
+ exports.isConfiguredOutput = isConfiguredOutput;
5
+ exports.normalizeOutputParam = normalizeOutputParam;
6
+ exports.normalizeInstanceOrArray = normalizeInstanceOrArray;
7
+ exports.normalizeConfig = normalizeConfig;
8
+ exports.hasNullableTypeRecursively = hasNullableTypeRecursively;
9
+ exports.isUsingTypes = isUsingTypes;
4
10
  const graphql_1 = require("graphql");
5
11
  const utils_js_1 = require("./utils.js");
6
12
  function isOutputConfigArray(type) {
7
13
  return Array.isArray(type);
8
14
  }
9
- exports.isOutputConfigArray = isOutputConfigArray;
10
15
  function isConfiguredOutput(type) {
11
16
  return typeof type === 'object';
12
17
  }
13
- exports.isConfiguredOutput = isConfiguredOutput;
14
18
  function normalizeOutputParam(config) {
15
19
  // In case of direct array with a list of plugins
16
20
  if (isOutputConfigArray(config)) {
@@ -25,7 +29,6 @@ function normalizeOutputParam(config) {
25
29
  }
26
30
  throw new Error(`Invalid "generates" config!`);
27
31
  }
28
- exports.normalizeOutputParam = normalizeOutputParam;
29
32
  function normalizeInstanceOrArray(type) {
30
33
  if (Array.isArray(type)) {
31
34
  return type;
@@ -35,7 +38,6 @@ function normalizeInstanceOrArray(type) {
35
38
  }
36
39
  return [type];
37
40
  }
38
- exports.normalizeInstanceOrArray = normalizeInstanceOrArray;
39
41
  function normalizeConfig(config) {
40
42
  if (typeof config === 'string') {
41
43
  return [{ [config]: {} }];
@@ -48,7 +50,6 @@ function normalizeConfig(config) {
48
50
  }
49
51
  return [];
50
52
  }
51
- exports.normalizeConfig = normalizeConfig;
52
53
  function hasNullableTypeRecursively(type) {
53
54
  if (!(0, graphql_1.isNonNullType)(type)) {
54
55
  return true;
@@ -58,7 +59,6 @@ function hasNullableTypeRecursively(type) {
58
59
  }
59
60
  return false;
60
61
  }
61
- exports.hasNullableTypeRecursively = hasNullableTypeRecursively;
62
62
  function isUsingTypes(document, externalFragments, schema) {
63
63
  let foundFields = 0;
64
64
  const typesStack = [];
@@ -166,4 +166,3 @@ function isUsingTypes(document, externalFragments, schema) {
166
166
  });
167
167
  return foundFields > 0;
168
168
  }
169
- exports.isUsingTypes = isUsingTypes;
package/cjs/oldVisit.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oldVisit = void 0;
3
+ exports.oldVisit = oldVisit;
4
4
  const graphql_1 = require("graphql");
5
5
  function oldVisit(root, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }) {
6
6
  if (typeof enterVisitors === 'object') {
@@ -17,4 +17,3 @@ function oldVisit(root, { enter: enterVisitors, leave: leaveVisitors, ...newVisi
17
17
  }
18
18
  return (0, graphql_1.visit)(root, newVisitor);
19
19
  }
20
- exports.oldVisit = oldVisit;
package/cjs/profiler.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createProfiler = exports.createNoopProfiler = void 0;
3
+ exports.createNoopProfiler = createNoopProfiler;
4
+ exports.createProfiler = createProfiler;
4
5
  function createNoopProfiler() {
5
6
  return {
6
7
  run(fn) {
@@ -11,7 +12,6 @@ function createNoopProfiler() {
11
12
  },
12
13
  };
13
14
  }
14
- exports.createNoopProfiler = createNoopProfiler;
15
15
  function createProfiler() {
16
16
  const events = [];
17
17
  return {
@@ -44,7 +44,6 @@ function createProfiler() {
44
44
  },
45
45
  };
46
46
  }
47
- exports.createProfiler = createProfiler;
48
47
  function hrtimeToMicroseconds(hrtime) {
49
48
  return (hrtime[0] * 1e9 + hrtime[1]) / 1000;
50
49
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveExternalModuleAndFn = void 0;
3
+ exports.resolveExternalModuleAndFn = resolveExternalModuleAndFn;
4
4
  const tslib_1 = require("tslib");
5
5
  const module_1 = require("module");
6
6
  const process_1 = require("process");
@@ -29,4 +29,3 @@ function resolveExternalModuleAndFn(pointer) {
29
29
  }
30
30
  return loadedModule[functionName] || loadedModule;
31
31
  }
32
- exports.resolveExternalModuleAndFn = resolveExternalModuleAndFn;
package/cjs/types.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isComplexPluginOutput = void 0;
3
+ exports.isComplexPluginOutput = isComplexPluginOutput;
4
4
  function isComplexPluginOutput(obj) {
5
5
  return typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, 'content');
6
6
  }
7
- exports.isComplexPluginOutput = isComplexPluginOutput;
package/cjs/utils.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeNonNullWrapper = exports.getBaseType = exports.isWrapperType = exports.mergeOutputs = void 0;
3
+ exports.mergeOutputs = mergeOutputs;
4
+ exports.isWrapperType = isWrapperType;
5
+ exports.getBaseType = getBaseType;
6
+ exports.removeNonNullWrapper = removeNonNullWrapper;
4
7
  const graphql_1 = require("graphql");
5
8
  function mergeOutputs(content) {
6
9
  const result = { content: '', prepend: [], append: [] };
@@ -18,19 +21,15 @@ function mergeOutputs(content) {
18
21
  }
19
22
  return [...result.prepend, result.content, ...result.append].join('\n');
20
23
  }
21
- exports.mergeOutputs = mergeOutputs;
22
24
  function isWrapperType(t) {
23
25
  return (0, graphql_1.isListType)(t) || (0, graphql_1.isNonNullType)(t);
24
26
  }
25
- exports.isWrapperType = isWrapperType;
26
27
  function getBaseType(type) {
27
28
  if (isWrapperType(type)) {
28
29
  return getBaseType(type.ofType);
29
30
  }
30
31
  return type;
31
32
  }
32
- exports.getBaseType = getBaseType;
33
33
  function removeNonNullWrapper(type) {
34
34
  return (0, graphql_1.isNonNullType)(type) ? type.ofType : type;
35
35
  }
36
- exports.removeNonNullWrapper = removeNonNullWrapper;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@graphql-codegen/plugin-helpers",
3
- "version": "5.0.4",
3
+ "version": "5.0.5-alpha-20240819192335-fa24f331c724b37a46cb22bbdd65aee967c15842",
4
4
  "description": "GraphQL Code Generator common utils and types",
5
5
  "peerDependencies": {
6
6
  "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"
7
7
  },
8
8
  "dependencies": {
9
9
  "@graphql-tools/utils": "^10.0.0",
10
- "change-case-all": "1.0.15",
10
+ "change-case-all": "2.1.0",
11
11
  "common-tags": "1.8.2",
12
12
  "import-from": "4.0.0",
13
13
  "lodash": "~4.17.0",
@@ -19,6 +19,9 @@
19
19
  "directory": "packages/utils/plugins-helpers"
20
20
  },
21
21
  "license": "MIT",
22
+ "engines": {
23
+ "node": ">=16"
24
+ },
22
25
  "main": "cjs/index.js",
23
26
  "module": "esm/index.js",
24
27
  "typings": "typings/index.d.ts",