Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/apollo-elements/apollo-elements

๐Ÿš€๐ŸŒ› Use the Launch Platform ๐Ÿ‘ฉโ€๐Ÿš€๐Ÿ‘จโ€๐Ÿš€
https://github.com/apollo-elements/apollo-elements

apollo-elements gluon graphql hacktoberfest hybrids lit-element lit-html mixins polymer webcomponents

Last synced: about 2 months ago
JSON representation

๐Ÿš€๐ŸŒ› Use the Launch Platform ๐Ÿ‘ฉโ€๐Ÿš€๐Ÿ‘จโ€๐Ÿš€

Lists

README

        

![Am Yisrael Chai - ืขื ื™ืฉืจืืœ ื—ื™](https://bennypowers.dev/assets/flag.am.yisrael.chai.png)


Apollo Elements

๐Ÿš€ Apollo Elements ๐Ÿ‘ฉโ€๐Ÿš€


๐ŸŒ‘ Custom elements meet Apollo GraphQL ๐ŸŒœ


๐Ÿ‘ฉโ€๐Ÿš€ It's one small step for a dev, one giant leap for the web platform! ๐Ÿ‘จโ€๐Ÿš€


[![Made with open-wc](https://img.shields.io/badge/made%20with-open--wc-blue)](https://open-wc.org)
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/apollo-elements/apollo-elements/issues)
[![ISC License](https://img.shields.io/npm/l/@apollo-elements/polymer)](https://github.com/apollo-elements/apollo-elements/blob/master/LICENCE.md)
[![Maintainability](https://api.codeclimate.com/v1/badges/9766ab3cacfe5bfeab25/maintainability)](https://codeclimate.com/github/apollo-elements/apollo-elements/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/9766ab3cacfe5bfeab25/test_coverage)](https://codeclimate.com/github/apollo-elements/apollo-elements/test_coverage)
[![Release](https://github.com/apollo-elements/apollo-elements/workflows/Release/badge.svg)](https://github.com/apollo-elements/apollo-elements/actions)

Apollo Elements offers packages based on a variety of underlying web component authoring libraries. You can pick the one that suits your project in order to keep your app sizes small.

```bash
npm init @apollo-elements
```

## ๐Ÿค– Demos
- [`#leeway`](https://leeway.apolloelements.dev) is an example chat PWA that uses `lit-apollo` to make it easier for you to avoid doing actual work. [Source Repository](https://github.com/apollo-elements/leeway)
- [`LaunchCTL`](https://launchctl.apolloelements.dev) is a simple PWA that displays info about [SpaceX](https://spacex.com) launches. It uses the unofficial [spacex.land](https://spacex.land) GraphQL API. [Source Repository](https://github.com/apollo-elements/launchctl)

## ๐Ÿ—บ Guides and Docs
If you just want to see the API Docs, check them out for all our packages at [apolloelements.dev](https://apolloelements.dev)

- [๐Ÿฅ‘ Core](https://apolloelements.dev/api/core/)
- [๐Ÿงฑ Components](https://apolloelements.dev/api/components/)
- [๐Ÿธ Mixins](https://apolloelements.dev/api/libraries/mixins/)
- [๐Ÿ”ฅ Lit](https://apolloelements.dev/api/libraries/lit-apollo/)
- [๐Ÿ FAST](https://apolloelements.dev/api/libraries/fast/)
- [๐Ÿ‘ป Haunted](https://apolloelements.dev/api/libraries/haunted/)
- [โš›๏ธ Atomico](https://apolloelements.dev/api/libraries/atomico/)
- [๐Ÿฆ„ Hybrids](https://apolloelements.dev/api/libraries/hybrids/)
- [๐Ÿ”ฌ Gluon](https://apolloelements.dev/api/libraries/gluon/)
- [๐Ÿงฌ Polymer](https://apolloelements.dev/api/libraries/polymer/)

## Use in any Framework

Elements created with Apollo Elements work in any framework. Write GraphQL components once and use them in page with ease, even Angular, Preact, React, Svelte, or Vue apps.

- [Angular โค๏ธ Apollo Elements](https://codesandbox.io/s/apollo-elements-in-angular-9smgl?file=/src/app/app.component.html)
- [Preact ๐Ÿ’™ Apollo Elements](https://codesandbox.io/s/apollo-elements-in-preact-yowom?file=/src/index.js)
- [React ๐Ÿ’œ Apollo Elements](https://codesandbox.io/s/apollo-elements-in-react-00ev3?file=/src/LaunchesDemo.js)
- [Svelte ๐Ÿงก Apollo Elements](https://codesandbox.io/s/apollo-elements-in-svelte-u6js9?file=/LaunchesDemo.svelte)
- [Vue ๐Ÿ’š Apollo Elements](https://codesandbox.io/s/apollo-elements-in-vue-cq769?file=/src/components/ApolloElementsDemo.vue)

## ๐Ÿ“ฆ Packages
Apollo Elements offers packages based on a variety of underlying web component authoring libraries. You can pick the one that suits your project and keep your bundle size small, or mix and match different libraries and approaches in the same app.

### ๐Ÿฅ‘ Core

Reactive GraphQL controllers contain sharable, reusable, and stackable logic.

```bash
npm i -S @apollo-elements/core@next
```

```js
import { ApolloQueryController } from '@apollo-elements/core/apollo-query-controller';
import { ApolloMutationController } from '@apollo-elements/core/apollo-mutation-controller';
import { ApolloSubscriptionController } from '@apollo-elements/core/apollo-subscription-controller';
```

### ๐Ÿงฑ Components

Write GraphQL apps in HTML.

- `` provides all it's children (even across open shadow roots) with a client instance.
- `` write GraphQL queries and their templates in HTML.
- `` declarative mutation components in HTML.
- `` write realtime GraphQL subscriptions and their templates in HTML.

```bash
npm i -S @apollo-elements/components@next
```

```html








  • {{ item.name }}












User Name

Avatar Image

{{ data.addUser.name }} added!

```

[Read More](https://apolloelements.dev/api/components/)

### ๐Ÿธ Mixins

These custom element [class mixins](http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/) give you all the features you need to connect your components to your Apollo cache without imposing a specific component library.

```bash
npm i -S @apollo-elements/mixins@next
```

```js
import { ApolloQueryMixin } from '@apollo-elements/mixins/apollo-query-mixin';
import { ApolloMutationMixin } from '@apollo-elements/mixins/apollo-mutation-mixin';
import { ApolloSubscriptionMixin } from '@apollo-elements/mixins/apollo-subscription-mixin';
```

[Read More](https://apolloelements.dev/api/libraries/mixins/)

### ๐Ÿ”ฅ lit-apollo
These base classes extend from [`LitElement`](https://lit.dev), so you can quickly get up and running creating declarative front-ends with Apollo GraphQL.

```bash
npm i -S @apollo-elements/lit-apollo@next
```

```js
import { ApolloQuery } from '@apollo-elements/lit-apollo/apollo-query';
import { ApolloMutation } from '@apollo-elements/lit-apollo/apollo-mutation';
import { ApolloSubscription } from '@apollo-elements/lit-apollo/apollo-subscription';
```

[Read More](https://apolloelements.dev/api/libraries/lit-apollo/)

### ๐Ÿ FAST
These base classes extend from [`FASTElement`](https://fast.design), with all it's ergonomics and reactivity.

```bash
npm i -S @apollo-elements/fast@next
```

```js
import { ApolloQuery } from '@apollo-elements/fast/apollo-query';
import { ApolloMutation } from '@apollo-elements/fast/apollo-mutation';
import { ApolloSubscription } from '@apollo-elements/fast/apollo-subscription';
```

[Read More](https://apolloelements.dev/api/libraries/fast/)

### ๐Ÿ‘ป Haunted

Apollo hooks for web components, with [haunted](https://github.com/matthewp/haunted)!

```bash
npm i -S @apollo-elements/haunted@next
```

```js
import { useQuery } from '@apollo-elements/haunted/useQuery';
import { useMutation } from '@apollo-elements/haunted/useMutation';
import { useSubscription } from '@apollo-elements/haunted/useSubscription';
```

[Read More](https://apolloelements.dev/api/libraries/haunted/)

### โš›๏ธ Atomico

Alternate hooks implementation for web components, with [atomico](https://atomico.gitbook.io/doc/)!

```bash
npm i -S @apollo-elements/atomico@next
```

```js
import { useQuery } from '@apollo-elements/atomico/useQuery';
import { useMutation } from '@apollo-elements/atomico/useMutation';
import { useSubscription } from '@apollo-elements/atomico/useSubscription';
```

[Read More](https://apolloelements.dev/api/libraries/atomico/)

### ๐Ÿฆ„ Hybrids

Descriptor factories and object spreads you can roll into your [hybrids](https://hybrids.js.org) to make it easier to connect to your Apollo cache.

```bash
npm i -S @apollo-elements/hybrids@next
```

```js
import { query, mutation, subscription } from '@apollo-elements/hybrids';
```

[Read More](https://apolloelements.dev/api/libraries/hybrids/)

### ๐Ÿ‘ฉโ€๐Ÿ”ฌ Gluon
These base classes extend from [`GluonElement`](https://github.com/ruphin/gluonjs), a simplified wc library that uses `lit-html` for templating while keeping component state and lifecycle concerns 'close to the metal'.

```bash
npm i -S @apollo-elements/gluon@next
```

```js
import { ApolloQuery } from '@apollo-elements/gluon/apollo-query';
import { ApolloMutation } from '@apollo-elements/gluon/apollo-mutation';
import { ApolloSubscription } from '@apollo-elements/gluon/apollo-subscription';
```

[Read More](https://apolloelements.dev/api/libraries/gluon/)

### ๐Ÿงฌ Polymer

These custom elements fire [polymer](https://polymer-library.polymer-project.org)-style `*-changed` events when the Apollo cache updates their state. They extend directly from `HTMLElement` so they're small in size, and their notifying properties make them perfect for use in Polymer templates.

```bash
npm i -S @apollo-elements/polymer@next
```

```js
import '@apollo-elements/polymer/polymer-apollo-query';
import '@apollo-elements/polymer/polymer-apollo-mutation';
import '@apollo-elements/polymer/polymer-apollo-subscription';
```

[Read More](https://apolloelements.dev/api/libraries/polymer/)

## โ€๐Ÿ™๏ธ Acknowledgements
`apollo-elements` is a community project maintained by Benny Powers. We proudly use [Open Web Components](https://open-wc.org) and [Modern Web](https://modern-web.dev) tools. Thanks to [Netlify](https://netlify.com) and [Heroku](https://heroku.com) for hosting our documentation and demos.

[![Contact me on Codementor](https://cdn.codementor.io/badges/contact_me_github.svg)](https://www.codementor.io/bennyp?utm_source=github&utm_medium=button&utm_term=bennyp&utm_campaign=github)