apollo-client
Advanced tools
Comparing version 2.4.3-local-state-alpha.6 to 2.4.3-local-state-alpha.7
@@ -230,3 +230,3 @@ var __assign = (this && this.__assign) || function () { | ||
if (localResult) { | ||
updatedResult.data = localResult; | ||
updatedResult.data = __assign({}, updatedResult.data, localResult); | ||
} | ||
@@ -787,3 +787,3 @@ _a.label = 2; | ||
var result = newInitializer(cache); | ||
if (result) { | ||
if (result !== null) { | ||
cache.writeData({ data: (_a = {}, _a[fieldName] = result, _a) }); | ||
@@ -859,3 +859,3 @@ } | ||
if (localResult) { | ||
updatedResult.data = localResult; | ||
updatedResult.data = __assign({}, updatedResult.data, localResult); | ||
} | ||
@@ -993,2 +993,3 @@ _a.label = 2; | ||
QueryManager.prototype.prepareLocalStateResolver = function (query) { | ||
var _this = this; | ||
var resolver = null; | ||
@@ -1005,5 +1006,5 @@ if (!query) { | ||
var resolverMap = resolvers[type]; | ||
if (resolverMap) { | ||
resolver = function (fieldName, rootValue, args, context, info) { | ||
if (rootValue === void 0) { rootValue = {}; } | ||
resolver = function (fieldName, rootValue, args, context, info) { | ||
if (rootValue === void 0) { rootValue = {}; } | ||
if (resolverMap) { | ||
var resolve = resolverMap[fieldName]; | ||
@@ -1013,5 +1014,11 @@ if (resolve) { | ||
} | ||
} | ||
if (Object.prototype.hasOwnProperty.call(rootValue, fieldName)) { | ||
return rootValue[fieldName]; | ||
}; | ||
} | ||
} | ||
var cache = _this.dataStore.getCache(); | ||
var cacheContents = cache.extract(); | ||
var rootQuery = cacheContents.ROOT_QUERY; | ||
return rootQuery ? rootQuery[fieldName] : undefined; | ||
}; | ||
return resolver; | ||
@@ -1018,0 +1025,0 @@ }; |
{ | ||
"name": "apollo-client", | ||
"version": "2.4.3-local-state-alpha.6", | ||
"version": "2.4.3-local-state-alpha.7", | ||
"description": "A simple yet functional GraphQL client.", | ||
@@ -28,7 +28,7 @@ "main": "bundle.umd.js", | ||
"@types/zen-observable": "^0.8.0", | ||
"apollo-cache": "1.1.18-local-state-alpha.6", | ||
"apollo-cache": "1.1.18-local-state-alpha.7", | ||
"apollo-link": "^1.0.0", | ||
"apollo-link-dedup": "^1.0.0", | ||
"apollo-utilities": "1.0.22-local-state-alpha.6", | ||
"graphql-anywhere": "4.1.20-local-state-alpha.6", | ||
"apollo-utilities": "1.0.22-local-state-alpha.7", | ||
"graphql-anywhere": "4.1.20-local-state-alpha.7", | ||
"symbol-observable": "^1.0.2", | ||
@@ -35,0 +35,0 @@ "zen-observable": "^0.8.0" |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.4.3-local-state-alpha.6"; | ||
export declare const version = "2.4.3-local-state-alpha.7"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,1 +0,1 @@ | ||
exports.version = "2.4.3-local-state-alpha.6" | ||
exports.version = "2.4.3-local-state-alpha.7" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
504310
4866
+ Addedapollo-cache@1.1.18-local-state-alpha.7(transitive)
+ Addedapollo-utilities@1.0.22-local-state-alpha.7(transitive)
+ Addedgraphql-anywhere@4.1.20-local-state-alpha.7(transitive)
- Removedapollo-cache@1.1.18-local-state-alpha.6(transitive)
- Removedapollo-utilities@1.0.22-local-state-alpha.6(transitive)
- Removedgraphql-anywhere@4.1.20-local-state-alpha.6(transitive)