
Security News
Socket Integrates With Bun 1.3βs Security Scanner API
Socket now integrates with Bun 1.3βs Security Scanner API to block risky packages at install time and enforce your organizationβs policies in local dev and CI.
@apollo-elements/gluon
Advanced tools
π©βππ Gluon Elements for Apollo GraphQL ππ¨βπ
π GluonElement base classes that connect to your Apollo cache π
π©βπ We choose to Use the Platform not because it is easy, but because it is awesome π¨βπ
Gluon is a simple, unopinionated UI library which uses lit-html
for templating without piling on property observation or lifecycle cruft. Check out the gluon repository or this introductory blog post
π Read the Full API Docs π
Apollo Gluon elements 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/gluon
See our docs on setting up Apollo client so your components can fetch their data.
Read our docs on working with GraphQL files during development and in production for more info, and be sure to read about generating TypeScript types from GraphQL to enhance your developer experience and reduce bugs.
Typical usage involves importing the base class and extending from it to define your component:
query ParentQuery {
helloWorld {
name
greeting
}
}
import { ApolloQuery, html } from '@apollo-elements/gluon';
import ParentQuery from './Parent.query.graphql';
class ConnectedElement extends ApolloQuery {
get template() {
return (
this.loading ? html`
<what-spin></what-spin>`
: this.error ? html`
<h1>π’ Such Sad, Very Error! π°</h1>
<div>${this.error?.message ?? 'Unknown Error'}</div>`
: html`
<div>${this.data?.helloWorld?.greeting}, ${this.data?.helloWorld?.name}</div>
<connected-child id="child-component"></connected-child>`
);
}
constructor() {
super();
this.query = query;
}
};
customElements.define('connected-element', ConnectedElement)
import { ApolloMutation, html } from '@apollo-elements/gluon';
import InputMutation from './Input.mutation.graphql';
class MutationElement extends ApolloMutation {
mutation = InputMutation;
get template() {
return html`<input @keyup="${this.onInput}"/>`;
}
onInput({ target: { value: input }, key }) {
this.variables = { input };
if (key === 'Enter') return this.mutate();
}
};
customElements.define('input-mutation', MutationElement)
Looking for other libraries? Want to use Apollo with vanilla extends HTMLElement
components? Check out our docs site
apollo-elements
is a community project maintained by Benny Powers.
FAQs
π©βππ Gluon Elements for Apollo GraphQL ππ¨βπ
The npm package @apollo-elements/gluon receives a total of 91 weekly downloads. As such, @apollo-elements/gluon popularity was classified as not popular.
We found that @apollo-elements/gluon demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket now integrates with Bun 1.3βs Security Scanner API to block risky packages at install time and enforce your organizationβs policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.