How to use the @apollo-elements/mixins/apollo-element-mixin.js.ApolloElementMixin function in @apollo-elements/mixins

To help you get started, weโ€™ve selected a few @apollo-elements/mixins examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apollo-elements / apollo-elements / packages / lit-apollo / apollo-element.js View on Github external
export { html } from 'lit-element';
import { LitElement } from 'lit-element';
import { ApolloElementMixin } from '@apollo-elements/mixins/apollo-element-mixin.js';

/**
 * # ApolloElement
 *
 * Custom Element base class for apollo custom elements.
 *
 * @polymer
 * @extends LitElement
 * @appliesMixin ApolloElementMixin
 */
export class ApolloElement extends ApolloElementMixin(LitElement) {
  static get properties() {
    return {
      /**
       * The Apollo client.
       * See https://github.com/apollo-elements/apollo-elements#-bundling
       * @type {Object}
       */
      client: { type: Object },

      /**
       * The latest data for the query from the Apollo cache
       * @type {Object}
       */
      data: { type: Object },

      /**
github apollo-elements / apollo-elements / packages / gluon / apollo-element.js View on Github external
export { html } from '@gluon/gluon';
import { GluonElement } from '@gluon/gluon';
import { ApolloElementMixin } from '@apollo-elements/mixins/apollo-element-mixin.js';

/**
 * # ApolloElement
 *
 * Custom Element base class for apollo custom elements.
 *
 * @polymer
 * @extends GluonElement
 * @appliesMixin ApolloElementMixin
 */
export class ApolloElement extends ApolloElementMixin(GluonElement) {
  /**
   * The latest data for the query from the Apollo cache
   *
   * @return {Object}
   */
  get data() {
    return this.__data;
  }

  set data(data) {
    this.__data = data;
    this.render();
  }

  /**
   * The latest error for the query from the Apollo cache