
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
apollo-angular
Advanced tools
Apollo Angular allows you to fetch data from your GraphQL server and use it in building complex and reactive UIs using the Angular framework. Apollo Angular may be used in any context that Angular may be used. In the browser, in NativeScript, or in Node.js when you want to do server-side rendering.
Apollo Angular requires no complex build setup to get up and running. As long as you have a
GraphQL server you can get started building out your application with Angular immediately. Apollo
Angular works out of the box with both Angular CLI
(ng add apollo-angular) and NativeScript with a single install.
Apollo Angular is:
Get started today on the app you’ve been dreaming of, and let Apollo Angular take you to the moon!
It is simple to install Apollo Angular and related libraries
# installing Apollo Angular in Angular CLI
ng add apollo-angular
# installing each piece independently
yarn add @apollo/client apollo-angular graphql
That’s it! You may now use Apollo Angular in any of your Angular environments.
For an amazing developer experience you may also install the Apollo Client Developer tools for Chrome which will give you inspectability into your Apollo Angular data.
apollo-angular@v3
If you are using Apollo-Client v2, please make sure to use
apollo-angular@v1(and for Angular 10 support, make sure to usev1.10.0)
Now you may create components that are connected to your GraphQL API.
Finally, to demonstrate the power of Apollo Angular in building interactive UIs let us connect one
of your components to your GraphQL server using the Apollo service:
import { Apollo, gql } from 'apollo-angular';
import { map, Observable } from 'rxjs';
import { AsyncPipe } from '@angular/common';
import { Component, OnInit } from '@angular/core';
const GET_DOGS = gql`
{
dogs {
id
breed
}
}
`;
@Component({
selector: 'dogs',
template: `
<ul>
@for (dog of dogs | async; track dog.id) {
<li>
{{ dog.breed }}
</li>
}
</ul>
`,
})
export class DogsComponent implements OnInit {
public dogs!: Observable<any>;
constructor(private readonly apollo: Apollo) {}
ngOnInit() {
this.dogs = this.apollo
.watchQuery({
query: GET_DOGS,
})
.valueChanges.pipe(map(result => result.data && result.data.dogs));
}
}
To learn more about querying with Apollo Angular be sure to start reading the documentation article on queries.
All the documentation for Apollo Angular including usage articles and helpful recipes lives on: https://www.apollo-angular.com/
Read the Apollo Contributor Guidelines.
This project uses Lerna.
Bootstrapping:
yarn install
Running tests locally:
yarn test
Formatting code with prettier:
yarn prettier
This project uses TypeScript for static typing. You can get it built into your editor with no configuration by opening this project in Visual Studio Code, an open source IDE which is available for free on all platforms.
urql is a highly customizable and versatile GraphQL client for React and other frameworks. It offers similar functionalities to apollo-angular, such as querying, mutating, and subscribing to data, but is designed to be more lightweight and modular.
relay-runtime is a core runtime for Relay, a GraphQL client developed by Facebook. It is designed for high-performance applications and offers advanced features like data normalization and efficient caching. While it is more complex to set up compared to apollo-angular, it provides powerful tools for managing GraphQL data.
graphql-request is a minimalistic GraphQL client for Node.js and browsers. It provides a simple API for making GraphQL queries and mutations. Unlike apollo-angular, it does not include advanced features like caching or subscriptions, making it a lightweight alternative for basic use cases.
FAQs
Use your GraphQL data in your Angular app, with the Apollo Client
The npm package apollo-angular receives a total of 168,849 weekly downloads. As such, apollo-angular popularity was classified as popular.
We found that apollo-angular demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.