@graphql-codegen/typescript-react-apollo 4.4.3-alpha-20260808101442-e439530add2acc6e119f54b148ccb537e4d0a7ec → 5.0.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/cjs/visitor.js +2 -2
- package/esm/visitor.js +2 -2
- package/package.json +2 -2
package/cjs/visitor.js
CHANGED
|
@@ -190,7 +190,7 @@ class ReactApolloVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
|
|
|
190
190
|
return [componentProps, component].join('\n');
|
|
191
191
|
}
|
|
192
192
|
_buildHooksJSDoc(node, operationName, operationType) {
|
|
193
|
-
const variableString =
|
|
193
|
+
const variableString = node.variableDefinitions.reduce((acc, item) => {
|
|
194
194
|
const name = item.variable.name.value;
|
|
195
195
|
return `${acc}\n * ${name}: // value for '${name}'`;
|
|
196
196
|
}, '');
|
|
@@ -366,7 +366,7 @@ export function use${suspenseOperationName}(baseOptions?: ${this.getApolloReactH
|
|
|
366
366
|
get fragments() {
|
|
367
367
|
var _a, _b;
|
|
368
368
|
const fragments = super.fragments;
|
|
369
|
-
if (this['_fragments'].
|
|
369
|
+
if (this['_fragments'].size === 0 || !this.config.withFragmentHooks) {
|
|
370
370
|
return fragments;
|
|
371
371
|
}
|
|
372
372
|
const operationType = 'Fragment';
|
package/esm/visitor.js
CHANGED
|
@@ -186,7 +186,7 @@ export class ReactApolloVisitor extends ClientSideBaseVisitor {
|
|
|
186
186
|
return [componentProps, component].join('\n');
|
|
187
187
|
}
|
|
188
188
|
_buildHooksJSDoc(node, operationName, operationType) {
|
|
189
|
-
const variableString =
|
|
189
|
+
const variableString = node.variableDefinitions.reduce((acc, item) => {
|
|
190
190
|
const name = item.variable.name.value;
|
|
191
191
|
return `${acc}\n * ${name}: // value for '${name}'`;
|
|
192
192
|
}, '');
|
|
@@ -362,7 +362,7 @@ export function use${suspenseOperationName}(baseOptions?: ${this.getApolloReactH
|
|
|
362
362
|
get fragments() {
|
|
363
363
|
var _a, _b;
|
|
364
364
|
const fragments = super.fragments;
|
|
365
|
-
if (this['_fragments'].
|
|
365
|
+
if (this['_fragments'].size === 0 || !this.config.withFragmentHooks) {
|
|
366
366
|
return fragments;
|
|
367
367
|
}
|
|
368
368
|
const operationType = 'Fragment';
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-react-apollo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating a ready-to-use React Components/HOC/Hooks based on GraphQL operations",
|
|
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-codegen/plugin-helpers": "^6.3.0",
|
|
10
|
-
"@graphql-codegen/visitor-plugin-common": "^
|
|
10
|
+
"@graphql-codegen/visitor-plugin-common": "^7.2.2",
|
|
11
11
|
"auto-bind": "~4.0.0",
|
|
12
12
|
"change-case-all": "1.0.15",
|
|
13
13
|
"tslib": "^2.8.1"
|