apollo-magic-refetch
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -22,6 +22,8 @@ 'use strict'; | ||
var potentialAncestors = (0, _getPotentialAncestors2.default)(types[typename]); | ||
var targetType = types[typename]; | ||
if (!targetType) throw new Error('type not found: ' + typename); | ||
var potentialAncestors = (0, _getPotentialAncestors2.default)(targetType); | ||
function doesNodeContain(node, data, type) { | ||
if (type.name === typename) { | ||
if (type === targetType) { | ||
if (!ids) return true; | ||
@@ -28,0 +30,0 @@ return data && ids.has(data[idField]); |
import getPotentialAncestors from './getPotentialAncestors'; | ||
export default function doesQueryContain(document, types, typename, data, ids, idField = 'id') { | ||
const potentialAncestors = getPotentialAncestors(types[typename]); | ||
const targetType = types[typename]; | ||
if (!targetType) throw new Error(`type not found: ${typename}`); | ||
const potentialAncestors = getPotentialAncestors(targetType); | ||
function doesNodeContain(node, data, type) { | ||
if (type.name === typename) { | ||
if (type === targetType) { | ||
if (!ids) return true; | ||
@@ -9,0 +11,0 @@ return data && ids.has(data[idField]); |
{ | ||
"name": "apollo-magic-refetch", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "magically refetches relevant queries after creates and deletes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
269675
692