@graphql-codegen/visitor-plugin-common 7.0.1 → 7.0.2

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.
@@ -221,16 +221,18 @@ class SelectionSetToObject {
221
221
  fieldNodes.push(selection);
222
222
  break;
223
223
  case graphql_1.Kind.INLINE_FRAGMENT:
224
- if ((0, utils_js_1.hasConditionalDirectives)(selection.directives) ||
225
- (0, utils_js_1.hasIncrementalDeliveryDirectives)(selection.directives)) {
224
+ if (!this._config.extractAllFieldsToTypesCompact &&
225
+ ((0, utils_js_1.hasConditionalDirectives)(selection.directives) ||
226
+ (0, utils_js_1.hasIncrementalDeliveryDirectives)(selection.directives))) {
226
227
  inlineFragmentConditionalSelections.push(selection);
227
228
  break;
228
229
  }
229
230
  inlineFragmentSelections.push(selection);
230
231
  break;
231
232
  case graphql_1.Kind.FRAGMENT_SPREAD:
232
- if ((0, utils_js_1.hasConditionalDirectives)(selection.directives) ||
233
- (0, utils_js_1.hasIncrementalDeliveryDirectives)(selection.directives)) {
233
+ if (!this._config.extractAllFieldsToTypesCompact &&
234
+ ((0, utils_js_1.hasConditionalDirectives)(selection.directives) ||
235
+ (0, utils_js_1.hasIncrementalDeliveryDirectives)(selection.directives))) {
234
236
  fragmentSpreadsConditionalSelections.push(selection);
235
237
  break;
236
238
  }
@@ -217,16 +217,18 @@ export class SelectionSetToObject {
217
217
  fieldNodes.push(selection);
218
218
  break;
219
219
  case Kind.INLINE_FRAGMENT:
220
- if (hasConditionalDirectives(selection.directives) ||
221
- hasIncrementalDeliveryDirectives(selection.directives)) {
220
+ if (!this._config.extractAllFieldsToTypesCompact &&
221
+ (hasConditionalDirectives(selection.directives) ||
222
+ hasIncrementalDeliveryDirectives(selection.directives))) {
222
223
  inlineFragmentConditionalSelections.push(selection);
223
224
  break;
224
225
  }
225
226
  inlineFragmentSelections.push(selection);
226
227
  break;
227
228
  case Kind.FRAGMENT_SPREAD:
228
- if (hasConditionalDirectives(selection.directives) ||
229
- hasIncrementalDeliveryDirectives(selection.directives)) {
229
+ if (!this._config.extractAllFieldsToTypesCompact &&
230
+ (hasConditionalDirectives(selection.directives) ||
231
+ hasIncrementalDeliveryDirectives(selection.directives))) {
230
232
  fragmentSpreadsConditionalSelections.push(selection);
231
233
  break;
232
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/visitor-plugin-common",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
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
  },