@swan-io/graphql-client
Advanced tools
Comparing version 0.1.0-beta3 to 0.1.0-beta4
@@ -822,12 +822,21 @@ 'use strict'; | ||
}); | ||
const nextValue = Array(fieldValue.length); | ||
cache.updateFieldInClosestCachedAncestor({ | ||
originalFieldName, | ||
fieldNameWithArguments, | ||
value: nextValue, | ||
path: [...path, fieldNameWithArguments], | ||
ancestors: [...data, fieldValue], | ||
variables: fieldArguments, | ||
rootTypename, | ||
selectedKeys | ||
}); | ||
fieldValue.forEach((item, index) => { | ||
const value = cache.cacheIfEligible(item, selectedKeys); | ||
const nextValue = Array(fieldValue.length); | ||
nextValue[index] = value; | ||
cache.updateFieldInClosestCachedAncestor({ | ||
originalFieldName, | ||
fieldNameWithArguments, | ||
value: nextValue, | ||
path, | ||
ancestors: data, | ||
originalFieldName: index.toString(), | ||
fieldNameWithArguments: index.toString(), | ||
value, | ||
path: [...path, fieldNameWithArguments], | ||
ancestors: [...data, fieldValue], | ||
variables: fieldArguments, | ||
@@ -837,3 +846,3 @@ rootTypename, | ||
}); | ||
if (isRecord(item) && !Array.isArray(item)) { | ||
if (isRecord(item)) { | ||
traverse( | ||
@@ -840,0 +849,0 @@ fieldNode.selectionSet, |
{ | ||
"name": "@swan-io/graphql-client", | ||
"version": "0.1.0-beta3", | ||
"version": "0.1.0-beta4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A simple, typesafe GraphQL client for React", |
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
330141
3143