Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.
v1
Recipes
Angular CLI

Angular CLI

Setup

To get started with Apollo and Angular run:

ng add apollo-angular

Proxy

If your GraphQL endpoint lives under different host with Angular CLI you can easily define proxy configuration.

Take for example api.example.com/graphql:

{
  "/graphql": {
    "target": "http://api.example.com"
  }
}

Create a json file (proxy.config.json for example) with that configuration.

To run server use --proxy-config option:

ng serve --proxy-config <path to file>

An example:

ng serve --proxy-config proxy.config.json