@graphql-tools/delegate 10.0.2 → 10.0.3-alpha-20230907143500-4c6712a4
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.
|
@@ -30,6 +30,10 @@ function finalizeGatewayDocument(targetSchema, fragments, operations) {
|
|
|
30
30
|
newFragments = collectedNewFragments;
|
|
31
31
|
fragmentSet = collectedFragmentSet;
|
|
32
32
|
const variableDefinitions = (operation.variableDefinitions ?? []).filter((variable) => operationOrFragmentVariables.indexOf(variable.variable.name.value) !== -1);
|
|
33
|
+
// Prevent unnecessary __typename in Subscription
|
|
34
|
+
if (operation.operation === 'subscription') {
|
|
35
|
+
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !== graphql_1.Kind.FIELD || selection.name.value !== '__typename');
|
|
36
|
+
}
|
|
33
37
|
newOperations.push({
|
|
34
38
|
kind: graphql_1.Kind.OPERATION_DEFINITION,
|
|
35
39
|
operation: operation.operation,
|
|
@@ -27,6 +27,10 @@ function finalizeGatewayDocument(targetSchema, fragments, operations) {
|
|
|
27
27
|
newFragments = collectedNewFragments;
|
|
28
28
|
fragmentSet = collectedFragmentSet;
|
|
29
29
|
const variableDefinitions = (operation.variableDefinitions ?? []).filter((variable) => operationOrFragmentVariables.indexOf(variable.variable.name.value) !== -1);
|
|
30
|
+
// Prevent unnecessary __typename in Subscription
|
|
31
|
+
if (operation.operation === 'subscription') {
|
|
32
|
+
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !== Kind.FIELD || selection.name.value !== '__typename');
|
|
33
|
+
}
|
|
30
34
|
newOperations.push({
|
|
31
35
|
kind: Kind.OPERATION_DEFINITION,
|
|
32
36
|
operation: operation.operation,
|