Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@apollo-elements/fast
Advanced tools
π©βππ FastElements for Apollo GraphQL ππ¨βπ
π FASTElement base classes that connect to your Apollo cache π
π©βπ Launch your app at full speed! π¨βπ
Apollo elements' fast
is 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 computer then run the following command in your project's root directory:
npm install --save @apollo-elements/fast
See our docs on setting up Apollo client so your components can fetch their data.
First, let's define our component's GraphQL query.
query HelloQuery {
helloWorld {
name
greeting
}
}
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.
Next, we'll define our UI component. Import the base class and helpers, query, and types:
import { ApolloQuery, html, customElement } from '@apollo-elements/fast';
import HelloQuery from './Hello.query.graphql';
import type {
HelloQueryData as Data,
HelloQueryVariables as Variables
} from '../codegen/schema';
Then define your component's template. Make sure to set the query
field, so your component starts fetching data automatically.
Read more about working with Queries
const template = html<HelloQueryElement>`
<what-spin-such-loader ?active="${x => x.loading}"></what-spin-such-loader>
${x => (
x.error ? html`
<h1>π’ Such Sad, Very Error! π°</h1>
<pre><code>${error.message}</code></pre>`
: html`
<p>
${x.data?.helloWorld?.greeting ?? 'Hello'},
${x.data?.helloWorld?.name ?? 'Friend'}!
</p>`
)}
`;
@customElement({ name: 'hello-query', template })
export class HelloQueryElement extends ApolloQuery<Data, Variables> {
query = HelloQuery;
}
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
π©βππ FastElements for Apollo GraphQL ππ¨βπ
The npm package @apollo-elements/fast receives a total of 28 weekly downloads. As such, @apollo-elements/fast popularity was classified as not popular.
We found that @apollo-elements/fast 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.