@apollo-elements/mixins
Advanced tools
Comparing version 4.0.0-next.4 to 4.0.0-next.5
@@ -21,3 +21,3 @@ import { ApolloClient, InMemoryCache, } from '@apollo/client/core'; | ||
}); | ||
beforeEach(() => element.updateComplete); | ||
beforeEach(() => element.controller.host.updateComplete); | ||
it('provides access to the client', function () { | ||
@@ -24,0 +24,0 @@ expect(element.client).to.equal(client); |
import type { Constructor, MaybeTDN, MaybeVariables } from '@apollo-elements/core/types'; | ||
import type { ApolloElementElement } from '@apollo-elements/core'; | ||
import type { ApolloElementElement, ControllerHost } from '@apollo-elements/core'; | ||
declare type MixinInstance<B extends Constructor<HTMLElement>> = B & { | ||
new <D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(): ApolloElementElement<D, V>; | ||
new <D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(): ControllerHost & ApolloElementElement<D, V>; | ||
documentType: 'document' | 'mutation' | 'query' | 'subscription'; | ||
@@ -6,0 +6,0 @@ observedAttributes?: string[]; |
@@ -6,3 +6,3 @@ import { html, unsafeStatic } from 'lit/static-html.js'; | ||
import { assertType, isApolloError } from '@apollo-elements/test'; | ||
import NoParamQuery from '@apollo-elements/test/graphql/NoParam.query.graphql'; | ||
import * as S from '@apollo-elements/test/schema'; | ||
class XL extends HTMLElement { | ||
@@ -210,7 +210,7 @@ } | ||
element = await fixture(html ` | ||
<${tag} .document="${NoParamQuery}"></${tag}> | ||
<${tag} .document="${S.NoParamQuery}"></${tag}> | ||
`); | ||
}); | ||
it('sets the document property', function () { | ||
expect(element.document).to.deep.equal(NoParamQuery); | ||
expect(element.document).to.deep.equal(S.NoParamQuery); | ||
}); | ||
@@ -217,0 +217,0 @@ }); |
@@ -1,5 +0,5 @@ | ||
import type { Constructor, MaybeTDN, MaybeVariables } from '@apollo-elements/core/types'; | ||
import type { Constructor, ControllerHost, MaybeTDN, MaybeVariables } from '@apollo-elements/core/types'; | ||
import type { ApolloMutationElement } from '@apollo-elements/core/types'; | ||
declare type MixinInstance<B extends Constructor> = B & { | ||
new <D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(): InstanceType<B> & ApolloMutationElement<D, V>; | ||
new <D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(): ControllerHost & InstanceType<B> & ApolloMutationElement<D, V>; | ||
documentType: 'mutation'; | ||
@@ -6,0 +6,0 @@ observedAttributes?: string[]; |
@@ -267,3 +267,3 @@ import type { TypedDocumentNode } from '@apollo/client/core'; | ||
} & { | ||
new <D_1 extends I.MaybeTDN = I.MaybeTDN, V_1 = I.MaybeVariables<D_1>>(): { | ||
new <D_1 extends I.MaybeTDN = I.MaybeTDN, V_1 = I.MaybeVariables<D_1>>(): I.ControllerHost & { | ||
hi?: "hi" | undefined; | ||
@@ -270,0 +270,0 @@ accessKey: string; |
@@ -41,3 +41,3 @@ import * as S from '@apollo-elements/test/schema'; | ||
async hasRendered() { | ||
await this.updateComplete; | ||
await this.controller.host.updateComplete; | ||
await nextFrame(); | ||
@@ -44,0 +44,0 @@ return this; |
@@ -36,3 +36,2 @@ import { __decorate } from "tslib"; | ||
* Override to prevent subscribing unless your conditions are met | ||
* @override | ||
*/ | ||
@@ -39,0 +38,0 @@ shouldSubscribe(options) { |
@@ -34,3 +34,3 @@ import { defineCE, expect, fixture } from '@open-wc/testing'; | ||
async hasRendered() { | ||
await this.updateComplete; | ||
await this.controller.host.updateComplete; | ||
return this; | ||
@@ -37,0 +37,0 @@ } |
@@ -118,3 +118,4 @@ { | ||
"text": "OptimisticResponseType<D, V>" | ||
} | ||
}, | ||
"description": "An object that represents the result of this mutation that will be optimistically\nstored before the server has actually returned a result, or a unary function that\ntakes the mutation's variables and returns such an object.\n\nThis is most often used for optimistic UI, where we want to be able to see\nthe result of a mutation immediately, and update the UI later if any errors\nappear." | ||
}, | ||
@@ -121,0 +122,0 @@ { |
@@ -327,3 +327,3 @@ import { spy } from 'sinon'; | ||
async hasRendered() { | ||
await this.updateComplete; | ||
await this.controller.host.updateComplete; | ||
return this; | ||
@@ -461,3 +461,3 @@ } | ||
async hasRendered() { | ||
await this.updateComplete; | ||
await this.controller.host.updateComplete; | ||
return this; | ||
@@ -464,0 +464,0 @@ } |
{ | ||
"name": "@apollo-elements/mixins", | ||
"version": "4.0.0-next.4", | ||
"version": "4.0.0-next.5", | ||
"description": "👩🚀🌛 Custom Element class mixins for Apollo GraphQL 🚀👨🚀", | ||
@@ -43,6 +43,2 @@ "main": "index.js", | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.com" | ||
}, | ||
"repository": { | ||
@@ -66,4 +62,4 @@ "type": "git", | ||
"dependencies": { | ||
"@apollo-elements/core": "^0.0.1-next.3", | ||
"@apollo/client": "^3.3.21", | ||
"@apollo-elements/core": "^0.0.1-next.5", | ||
"@apollo/client": "^3.3.21 || ^3.4.0-rc", | ||
"@open-wc/dedupe-mixin": "^1.3.0", | ||
@@ -70,0 +66,0 @@ "tslib": "^2.3.0" |
@@ -5,5 +5,3 @@ import { defineCE, expect, fixtureSync, nextFrame } from '@open-wc/testing'; | ||
import { setupClient, teardownClient } from '@apollo-elements/test'; | ||
import NoParamQuery from '@apollo-elements/test/graphql/NoParam.query.graphql'; | ||
import NullableParamQuery from '@apollo-elements/test/graphql/NullableParam.query.graphql'; | ||
import NonNullableParamQuery from '@apollo-elements/test/graphql/NonNullableParam.query.graphql'; | ||
import * as S from '@apollo-elements/test/schema'; | ||
describe('ValidateVariablesMixin', function () { | ||
@@ -14,3 +12,3 @@ let element; | ||
element.query = query; | ||
return element.updateComplete; | ||
return element.controller.host.updateComplete; | ||
}; | ||
@@ -41,3 +39,3 @@ } | ||
describe('when query has no params', function () { | ||
beforeEach(setQuery(NoParamQuery)); | ||
beforeEach(setQuery(S.NoParamQuery)); | ||
beforeEach(nextFrame); | ||
@@ -55,3 +53,3 @@ it('queries immediately', function () { | ||
describe('when query has only nullable params', function () { | ||
beforeEach(setQuery(NullableParamQuery)); | ||
beforeEach(setQuery(S.NullableParamQuery)); | ||
beforeEach(nextFrame); | ||
@@ -69,3 +67,3 @@ it('queries immediately', function () { | ||
describe('when query has only non-nullable params', function () { | ||
beforeEach(setQuery(NonNullableParamQuery)); | ||
beforeEach(setQuery(S.NonNullableParamQuery)); | ||
beforeEach(nextFrame); | ||
@@ -72,0 +70,0 @@ it('does not query', function () { |
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
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
Sorry, the diff of this file is not supported yet
368150
61
3894