Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@apollo-elements/mixins
Advanced tools
👩🚀🌛 Custom Element class mixins for Apollo GraphQL 🚀👨🚀
🍹 Moon mixins for cosmic components 👩🚀
A set of class mixin functions that add Apollo GraphQL goodness to your web component classes.
Apollo element mixins are distributed through npm
, the node package manager. To install a copy of the latest version in your project's node_modules
directory, install npm on your system then run the following command in your project's root directory:
npm install --save @apollo-elements/mixins
Here's an example that uses HTMLElement
import { ApolloQueryMixin } from '@apollo-elements/mixins/apollo-query-mixin.js';
class HelloQuery extends ApolloQueryMixin(HTMLElement) {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>/* ... */</style>
<p hidden>
<span id="greeting"></span>
<span id="name"></span>
</p>
`;
}
get data() {
return this.__data;
}
set data(data) {
this.__data = data;
this.render();
}
render() {
if (!this.data) return;
this.shadowRoot.getElementById('greeting').textContent =
this.data?.helloWorld.greeting ?? 'Hello';
this.shadowRoot.getElementById('name').textContent =
this.data?.helloWorld.name ?? 'Friend';
this.shadowRoot.querySelector('p').hidden = false;
}
}
customElements.define('hello-query', HelloQuery);
<hello-query>
<script type="application/graphql">
query HelloQuery {
helloWorld {
name
greeting
}
}
</script>
</hello-query>
Different kind of mixin. These are JS class mixins.
apollo-elements
is a community project maintained by Benny Powers.
FAQs
👩🚀🌛 Custom Element class mixins for Apollo GraphQL 🚀👨🚀
The npm package @apollo-elements/mixins receives a total of 179 weekly downloads. As such, @apollo-elements/mixins popularity was classified as not popular.
We found that @apollo-elements/mixins demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.