@apollo-elements/mixins
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -47,4 +47,4 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin'; | ||
this.loading = true; | ||
this.error = undefined; | ||
this.data = undefined; | ||
this.error = null; | ||
this.data = null; | ||
this.called = true; | ||
@@ -80,3 +80,3 @@ return this.client.mutate(options) | ||
this.error = null; | ||
this.data = data; | ||
this.data = data !== null && data !== void 0 ? data : null; | ||
} | ||
@@ -95,3 +95,3 @@ (_a = this.onCompleted) === null || _a === void 0 ? void 0 : _a.call(this, data); | ||
this.data = null; | ||
this.error = error; | ||
this.error = error !== null && error !== void 0 ? error : null; | ||
} | ||
@@ -98,0 +98,0 @@ (_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error); |
@@ -109,4 +109,4 @@ import type { DocumentNode } from 'graphql/language/ast'; | ||
this.loading = true; | ||
this.error = undefined; | ||
this.data = undefined; | ||
this.error = null; | ||
this.data = null; | ||
this.called = true; | ||
@@ -145,3 +145,3 @@ | ||
this.error = null; | ||
this.data = data; | ||
this.data = data ?? null; | ||
} | ||
@@ -160,3 +160,3 @@ this.onCompleted?.(data); | ||
this.data = null; | ||
this.error = error; | ||
this.error = error ?? null; | ||
} | ||
@@ -163,0 +163,0 @@ this.onError?.(error); |
@@ -124,3 +124,3 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin'; | ||
shouldSubscribe(options) { | ||
return true; | ||
return (void options, true); | ||
} | ||
@@ -127,0 +127,0 @@ /** |
import { expect, html as fhtml, defineCE, unsafeStatic, fixture, nextFrame, } from '@open-wc/testing'; | ||
import 'sinon-chai'; | ||
import gql from 'graphql-tag'; | ||
import { ObservableQuery } from '@apollo/client/core'; | ||
import { ObservableQuery, gql } from '@apollo/client/core'; | ||
import { match, stub, spy } from 'sinon'; | ||
@@ -6,0 +5,0 @@ import { client, setupClient, teardownClient, assertType, isApolloError, } from '@apollo-elements/test-helpers'; |
@@ -16,2 +16,3 @@ import type { | ||
ErrorPolicy, | ||
FetchPolicy, | ||
NetworkStatus, | ||
@@ -35,6 +36,4 @@ WatchQueryOptions, | ||
import gql from 'graphql-tag'; | ||
import { ObservableQuery, gql } from '@apollo/client/core'; | ||
import { ObservableQuery, FetchPolicy } from '@apollo/client/core'; | ||
import { match, stub, spy } from 'sinon'; | ||
@@ -41,0 +40,0 @@ |
@@ -202,3 +202,3 @@ import type { Constructor, ApolloQueryInterface } from '@apollo-elements/interfaces'; | ||
shouldSubscribe(options?: Partial<SubscriptionOptions>): boolean { | ||
return true; | ||
return (void options, true); | ||
} | ||
@@ -205,0 +205,0 @@ |
@@ -103,3 +103,3 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin'; | ||
shouldSubscribe(options) { | ||
return true; | ||
return (void options, true); | ||
} | ||
@@ -106,0 +106,0 @@ /** @private */ |
@@ -171,3 +171,3 @@ import type { DocumentNode } from 'graphql/language/ast'; | ||
shouldSubscribe(options?: Partial<SubscriptionOptions>): boolean { | ||
return true; | ||
return (void options, true); | ||
} | ||
@@ -174,0 +174,0 @@ |
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.0.1](https://github.com/apollo-elements/apollo-elements/compare/@apollo-elements/mixins@3.0.0...@apollo-elements/mixins@3.0.1) (2020-09-29) | ||
### Bug Fixes | ||
* **mixins:** never assign undefined to data ([8e90a0a](https://github.com/apollo-elements/apollo-elements/commit/8e90a0a499b4931f7d7a7f191e365c1010ae9bb2)) | ||
# [3.0.0](https://github.com/apollo-elements/apollo-elements/compare/@apollo-elements/mixins@2.0.1...@apollo-elements/mixins@3.0.0) (2020-09-24) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@apollo-elements/mixins", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "👩🚀🌛 Custom Element class mixins for Apollo GraphQL 🚀👨🚀", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@apollo-elements/interfaces": "^1.0.0", | ||
"@apollo-elements/interfaces": "^1.0.1", | ||
"@apollo-elements/lib": "^3.0.0", | ||
@@ -48,3 +48,3 @@ "@apollo/client": ">= 3", | ||
}, | ||
"gitHead": "9dea023bc5208b53a9c1c8b39169e469dec4e8a2" | ||
"gitHead": "dc80855945a5600d1e879afb6d3ea8e89dbf2bb5" | ||
} |
@@ -20,3 +20,3 @@ import type { TypePolicies } from '@apollo/client/core'; | ||
data: unknown; | ||
error: Error; | ||
error: Error | import("@apollo/client/errors").ApolloError; | ||
errors: readonly import("graphql").GraphQLError[]; | ||
@@ -23,0 +23,0 @@ loading: boolean; |
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
Sorry, the diff of this file is not supported yet
465366
6955