@swan-io/graphql-client
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -128,3 +128,3 @@ 'use strict'; | ||
this.operationCache.get(documentNode) | ||
).getWithDefault(/* @__PURE__ */ new Map()); | ||
).getOr(/* @__PURE__ */ new Map()); | ||
documentCache.set(serializedVariables, boxed.Option.Some(data)); | ||
@@ -516,3 +516,3 @@ this.operationCache.set(documentNode, documentCache); | ||
] | ||
})).getWithDefault(newSelectionSet); | ||
})).getOr(newSelectionSet); | ||
}; | ||
@@ -710,3 +710,3 @@ var isExcluded = (fieldNode, variables) => { | ||
).flatMap((value2) => value2); | ||
if (previous.flatMap((previous2) => previous2.toOption()).map((previous2) => deepEqual(value, previous2)).getWithDefault(false)) { | ||
if (previous.flatMap((previous2) => previous2.toOption()).map((previous2) => deepEqual(value, previous2)).getOr(false)) { | ||
return previous; | ||
@@ -1145,3 +1145,3 @@ } else { | ||
headers, | ||
withCredentials: boxed.Option.fromNullable(withCredentials).getWithDefault(false), | ||
withCredentials: boxed.Option.fromNullable(withCredentials).getOr(false), | ||
body: JSON.stringify({ | ||
@@ -1210,5 +1210,3 @@ operationName, | ||
const transformedDocumentsForRequest = this.getTransformedDocumentsForRequest(document); | ||
const operationName = getExecutableOperationName(transformedDocument).getWithDefault( | ||
"Untitled" | ||
); | ||
const operationName = getExecutableOperationName(transformedDocument).getOr("Untitled"); | ||
const variablesAsRecord = variables; | ||
@@ -1231,5 +1229,3 @@ const possiblyOptimizedQuery = optimize ? optimizeQuery(this.cache, transformedDocument, variablesAsRecord).map( | ||
operationName, | ||
document: possiblyOptimizedQuery.getWithDefault( | ||
transformedDocumentsForRequest | ||
), | ||
document: possiblyOptimizedQuery.getOr(transformedDocumentsForRequest), | ||
variables: variablesAsRecord, | ||
@@ -1309,3 +1305,3 @@ ...overrides, | ||
const asyncData = react.useMemo(() => { | ||
return data.map((value) => boxed.AsyncData.Done(value)).getWithDefault(boxed.AsyncData.NotAsked()); | ||
return data.map((value) => boxed.AsyncData.Done(value)).getOr(boxed.AsyncData.NotAsked()); | ||
}, [data]); | ||
@@ -1467,3 +1463,3 @@ const runQuery = react.useCallback( | ||
const asyncData = react.useMemo(() => { | ||
return data.map((value) => boxed.AsyncData.Done(value)).getWithDefault(boxed.AsyncData.Loading()); | ||
return data.map((value) => boxed.AsyncData.Done(value)).getOr(boxed.AsyncData.Loading()); | ||
}, [data]); | ||
@@ -1470,0 +1466,0 @@ const previousAsyncData = usePreviousValue(asyncData); |
{ | ||
"name": "@swan-io/graphql-client", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "MIT", | ||
@@ -53,4 +53,4 @@ "description": "A simple, typesafe GraphQL client for React", | ||
"@0no-co/graphql.web": "^1.0.6", | ||
"@swan-io/boxed": "^2.1.1", | ||
"@swan-io/request": "^1.0.4", | ||
"@swan-io/boxed": "^2.2.1", | ||
"@swan-io/request": "^1.0.5", | ||
"ts-pattern": "^5.1.0" | ||
@@ -57,0 +57,0 @@ }, |
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
345279
3307
Updated@swan-io/boxed@^2.2.1
Updated@swan-io/request@^1.0.5