
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
apollo-angular-boost
Advanced tools
Easiest way to get started with Apollo Client!
Apollo Angular Boost is a zero-config way to start using Apollo. It includes some sensible defaults, such as our recommended InMemoryCache and HttpLink, which come configured for you with our recommended settings.
npm install apollo-angular-boost --save
or
yarn add apollo-angular-boost
Apollo Boost includes some packages that we think are essential to developing with Apollo Client. Here's what's in the box:
apollo-client: Where all the magic happensapollo-angular: Integrates Apollo Client with Angularapollo-cache-inmemory: Our recommended cacheapollo-angular-link-http: An Apollo Link for remote data fetching (based on Angular's HttpClient)apollo-link-error: An Apollo Link for error handlingapollo-link-state: An Apollo Link for local state managementgraphql-tag: Exports the gql function for your queries & mutationsThe awesome thing about Apollo Boost is that you don't have to set any of this up yourself! Just specify a few options if you'd like to use these features and we'll take care of the rest.
How to set it up?
import {HttpClientModule} from '@angular/common/http';
import {ApolloBoostModule, ApolloBoost} from 'apollo-angular-boost';
@NgModule({
imports: [HttpClientModule, ApolloBoostModule],
})
export class AppModule {
constructor(apolloBoost: ApolloBoost) {
apolloBoost.create({
uri,
});
}
}
How to use it in a component or a service?
import {Apollo, gql} from 'apollo-angular-boost';
export class AppComponent {
constructor(apollo: Apollo) {
const allPosts = apollo.watchQuery({
query: gql`
query allPosts {
posts {
id
title
text
}
}
`,
});
// ...
}
}
To read more about the API and its usage, please visit Apollo Angular documentation.
Because Apollo service of apollo-angular-boost is the same service that apollo-angular exports the documentation works for both.
Here are the options you can pass to the ApolloBoost exported from apollo-angular-boost. None of them are required.
/graphqlfetchOptions, you can add them to the context of the operation with operation.setContext({ headers }). Any options set here will take precedence over fetchOptions.apollo-link-state. This is useful if you would like to use the Apollo cache for local state management. Learn more in our quick start.That's it! Here's an example of all those options in action:
import { ApolloBoost } from 'apollo-boost';
@NgModule({...})
export class GraphQLModule {
constructor(apollo: ApolloBoost) {
apollo.create({
uri: 'https://nx9zvp49q7.lp.gql.zone/graphql',
fetchOptions: {
credentials: 'include'
},
request: async (operation) => {
const token = await AsyncStorage.getItem('token');
operation.setContext({
headers: {
authorization: token
}
});
},
onError: ({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
sendToLoggingService(graphQLErrors);
}
if (networkError) {
logoutUser();
}
},
clientState: {
defaults: {
isConnected: true
},
resolvers: {
Mutation: {
updateNetworkStatus: (_, { isConnected }, { cache }) => {
cache.writeData({ data: { isConnected }});
return null;
}
}
}
},
cacheRedirects: {
Query: {
movie: (_, { id }, { getCacheKey }) =>
getCacheKey({ __typename: 'Movie', id });
}
}
})
}
}
FAQs
The easiest way to get started with Apollo Client in Angular
The npm package apollo-angular-boost receives a total of 114 weekly downloads. As such, apollo-angular-boost popularity was classified as not popular.
We found that apollo-angular-boost 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.