
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
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,
});
}
}
or via APOLLO_BOOST_CONFIG token:
import {HttpClientModule} from '@angular/common/http';
import {ApolloBoostModule, APOLLO_BOOST_CONFIG} from 'apollo-angular-boost';
@NgModule({
imports: [HttpClientModule, ApolloBoostModule],
providers: [{
provide: APOLLO_BOOST_CONFIG,
useFactory() {
return {
uri
};
}
}]
})
export class AppModule {}
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.
/graphqlhttpOptions, you can add them to the context of the operation with operation.setContext({ headers }). Any options set here will take precedence over httpOptions.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://5vxky4z9pl.sse.codesandbox.io/graphql',
httpOptions: {
withCredentials: true
},
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 45 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.