@graphql-tools/wrap
Advanced tools
Comparing version 6.0.4 to 6.0.5-alpha-9d37c5d.0
@@ -37,3 +37,2 @@ 'use strict'; | ||
Object.keys(operationTypes).forEach((operation) => { | ||
const resolveField = operation === 'subscription' ? 'subscribe' : 'resolve'; | ||
const rootType = operationTypes[operation]; | ||
@@ -53,5 +52,13 @@ if (rootType != null) { | ||
const finalResolver = createPossiblyNestedProxyingResolver(subschemaOrSubschemaConfig, proxyingResolver); | ||
resolvers[typeName][fieldName] = { | ||
[resolveField]: finalResolver, | ||
}; | ||
if (operation === 'subscription') { | ||
resolvers[typeName][fieldName] = { | ||
subscribe: finalResolver, | ||
resolve: (payload) => payload[fieldName], | ||
}; | ||
} | ||
else { | ||
resolvers[typeName][fieldName] = { | ||
resolve: finalResolver, | ||
}; | ||
} | ||
}); | ||
@@ -58,0 +65,0 @@ } |
@@ -33,3 +33,2 @@ import { GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, isSpecifiedScalarType, isScalarType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, GraphQLInputObjectType, isEnumType, GraphQLEnumType, GraphQLScalarType, visit, Kind, TypeInfo, visitWithTypeInfo, extendSchema, parse, getNullableType, BREAK, buildSchema, getIntrospectionQuery, buildClientSchema } from 'graphql'; | ||
Object.keys(operationTypes).forEach((operation) => { | ||
const resolveField = operation === 'subscription' ? 'subscribe' : 'resolve'; | ||
const rootType = operationTypes[operation]; | ||
@@ -49,5 +48,13 @@ if (rootType != null) { | ||
const finalResolver = createPossiblyNestedProxyingResolver(subschemaOrSubschemaConfig, proxyingResolver); | ||
resolvers[typeName][fieldName] = { | ||
[resolveField]: finalResolver, | ||
}; | ||
if (operation === 'subscription') { | ||
resolvers[typeName][fieldName] = { | ||
subscribe: finalResolver, | ||
resolve: (payload) => payload[fieldName], | ||
}; | ||
} | ||
else { | ||
resolvers[typeName][fieldName] = { | ||
resolve: finalResolver, | ||
}; | ||
} | ||
}); | ||
@@ -54,0 +61,0 @@ } |
{ | ||
"name": "@graphql-tools/wrap", | ||
"version": "6.0.4", | ||
"version": "6.0.5-alpha-9d37c5d.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,5 +10,5 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/delegate": "6.0.4", | ||
"@graphql-tools/schema": "6.0.4", | ||
"@graphql-tools/utils": "6.0.4", | ||
"@graphql-tools/delegate": "6.0.5-alpha-9d37c5d.0", | ||
"@graphql-tools/schema": "6.0.5-alpha-9d37c5d.0", | ||
"@graphql-tools/utils": "6.0.5-alpha-9d37c5d.0", | ||
"tslib": "~2.0.0" | ||
@@ -15,0 +15,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
257362
2265
2
+ Added@graphql-tools/delegate@6.0.5-alpha-9d37c5d.0(transitive)
+ Added@graphql-tools/schema@6.0.5-alpha-9d37c5d.0(transitive)
+ Added@graphql-tools/utils@6.0.5-alpha-9d37c5d.0(transitive)
- Removed@graphql-tools/delegate@6.0.4(transitive)
- Removed@graphql-tools/schema@6.0.4(transitive)
- Removed@graphql-tools/utils@6.0.4(transitive)