@swan-io/graphql-client
Advanced tools
Comparing version 0.1.0-beta7 to 0.1.0-beta8
@@ -168,3 +168,5 @@ 'use strict'; | ||
cacheIfEligible(value, requestedKeys) { | ||
return tsPattern.match(getCacheKeyFromJson(value)).with(boxed.Option.P.Some(tsPattern.P.select()), (cacheKey) => { | ||
const cacheKeyOption = getCacheKeyFromJson(value); | ||
if (cacheKeyOption.isSome()) { | ||
const cacheKey = cacheKeyOption.get(); | ||
const existingEntry = this.getOrDefault(cacheKey); | ||
@@ -179,3 +181,5 @@ this.set( | ||
return cacheKey; | ||
}).otherwise(() => value); | ||
} else { | ||
return value; | ||
} | ||
} | ||
@@ -537,4 +541,6 @@ updateFieldInClosestCachedAncestor({ | ||
return selections.selections.reduce((data2, selection) => { | ||
return data2.flatMap( | ||
(data3) => tsPattern.match(selection).with({ kind: graphql_web.Kind.FIELD }, (fieldNode) => { | ||
return data2.flatMap((data3) => { | ||
var _a; | ||
if (selection.kind === graphql_web.Kind.FIELD) { | ||
const fieldNode = selection; | ||
const originalFieldName = getFieldName(fieldNode); | ||
@@ -610,4 +616,5 @@ const fieldNameWithArguments = getFieldNameWithArguments( | ||
} | ||
}).with({ kind: graphql_web.Kind.INLINE_FRAGMENT }, (inlineFragmentNode) => { | ||
var _a; | ||
} | ||
if (selection.kind === graphql_web.Kind.INLINE_FRAGMENT) { | ||
const inlineFragmentNode = selection; | ||
const typeCondition = (_a = inlineFragmentNode.typeCondition) == null ? void 0 : _a.name.value; | ||
@@ -660,6 +667,6 @@ const dataTypename = tsPattern.match(data3).with({ __typename: tsPattern.P.select(tsPattern.P.string) }, (name) => name).with( | ||
); | ||
}).with({ kind: graphql_web.Kind.FRAGMENT_SPREAD }, () => { | ||
} else { | ||
return boxed.Option.None(); | ||
}).exhaustive() | ||
); | ||
} | ||
}); | ||
}, boxed.Option.Some(data)); | ||
@@ -666,0 +673,0 @@ }; |
{ | ||
"name": "@swan-io/graphql-client", | ||
"version": "0.1.0-beta7", | ||
"version": "0.1.0-beta8", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3276
342252