@graphql-codegen/client-preset 4.3.2 → 4.3.3

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/babel.js CHANGED
@@ -42,7 +42,7 @@ exports.default = (0, helper_plugin_utils_1.declare)((api, opts) => {
42
42
  ? visitor.getOperationVariableName(firstDefinition)
43
43
  : visitor.getFragmentVariableName(firstDefinition);
44
44
  const importPath = getRelativeImportPath(state, artifactDirectory);
45
- const importDeclaration = (0, template_1.default)(`
45
+ const importDeclaration = template_1.default.smart(`
46
46
  import { %%importName%% } from %%importPath%%
47
47
  `);
48
48
  program.unshiftContainer('body', importDeclaration({
package/cjs/index.js CHANGED
@@ -23,6 +23,7 @@ exports.preset = {
23
23
  if (options.plugins.length > 0 && Object.keys(options.plugins).some(p => p.startsWith('typescript'))) {
24
24
  throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
25
25
  }
26
+ // eslint-disable-next-line no-constant-binary-expression
26
27
  const isPersistedOperations = !!options.presetConfig?.persistedDocuments ?? false;
27
28
  const reexports = [];
28
29
  // the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
package/esm/babel.js CHANGED
@@ -39,7 +39,7 @@ export default declare((api, opts) => {
39
39
  ? visitor.getOperationVariableName(firstDefinition)
40
40
  : visitor.getFragmentVariableName(firstDefinition);
41
41
  const importPath = getRelativeImportPath(state, artifactDirectory);
42
- const importDeclaration = template(`
42
+ const importDeclaration = template.smart(`
43
43
  import { %%importName%% } from %%importPath%%
44
44
  `);
45
45
  program.unshiftContainer('body', importDeclaration({
package/esm/index.js CHANGED
@@ -18,6 +18,7 @@ export const preset = {
18
18
  if (options.plugins.length > 0 && Object.keys(options.plugins).some(p => p.startsWith('typescript'))) {
19
19
  throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
20
20
  }
21
+ // eslint-disable-next-line no-constant-binary-expression
21
22
  const isPersistedOperations = !!options.presetConfig?.persistedDocuments ?? false;
22
23
  const reexports = [];
23
24
  // the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/client-preset",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "description": "GraphQL Code Generator preset for client.",
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"