Questions tagged [apollo-angular]

Questions that are about the usage of the "apollo-angular" npm package which integrates ApolloClient with the Angular javascript framework.

Questions that are about the usage of the "apollo-angular" npm package which integrates ApolloClient with the Angular javascript framework. See https://github.com/apollographql/apollo-angular

85 questions
8
votes
2 answers

Connect an Angular app to multiple Apollo clients

Following the Apollo Angular docs, I applied this configuration to connect to a given graphql endpoint: import { HttpClientModule } from "@angular/common/http"; import { ApolloModule, APOLLO_OPTIONS } from "apollo-angular"; import { HttpLinkModule,…
Strider
  • 3,539
  • 5
  • 32
  • 60
7
votes
2 answers

How to use import { onError } from 'apollo-link-error' in angular to handle all errors

Below is my setup code for apollo angular: providers: [ { provide: APOLLO_OPTIONS, useFactory: (httpLink: HttpLink) => { return { cache: new InMemoryCache(), link: httpLink.create({ uri:…
Sunny G
  • 191
  • 2
  • 9
5
votes
0 answers

Unhandled GraphQL subscription error, when using apollos subscribeToMore method in an angular chat component for subscription

Problem Description I have a chat component in angular that gets messages from the backend via a graphql query. On the same query, I subscribe to updates when a new message is added via a graphql mutation. The messages subscription is coded as a…
5
votes
1 answer

Error of token refreshing in apollo-angular

I'm building an frontend app using apollo-angular. In my app I use JWT authentication system with a short-life access token and a long-life refresh token (they are transferred in an HTTP-only cookie instead of begin stored in HTTP-header). When I…
yh6
  • 379
  • 2
  • 13
5
votes
2 answers

How to enable cors for apollo-server-lambda

Ok so I see a lot of answers for how to enable cors for apollo-express, but I haven't found one really for apollo-server-lambda. This is the error that I'm getting from chrome: Access to XMLHttpRequest at…
Felipe Centeno
  • 2,911
  • 1
  • 21
  • 39
4
votes
4 answers

Install missing dependencies in angular 10

I am using apollo in my angular 10 and I have this problem after running ng serve ERROR in The target entry-point "apollo-angular" has missing dependencies: @angular/core apollo-client rxjs rxjs/operators apollo-link Is there a command to…
PureAbap
  • 99
  • 3
  • 13
4
votes
0 answers

Apollo angular query with variables failed to parse

I have this server API for pagination of Accounts { accounts (offset: 2, limit: 1) { key name } } All works well using Graphiql { "data": { "accounts": [ { "key": "fde3d97d-6a44-4c36-bc59-149a3e8e51ac", …
Gadi
  • 1,539
  • 22
  • 37
3
votes
1 answer

Graphql upload file shows as empty object

when I'm trying to upload file via Graphql mutation (apollo-angular) with parameter $file: Upload!, the variable value is shown as an empty object in developer tools: But I'm checking the value of the variable right before the request and the value…
Laker
  • 1,622
  • 4
  • 20
  • 32
3
votes
1 answer

How do I remove Apollo-Angular and ALL its dependeces?

After I installed apollo-angular and @apollo/client I decided that I don't want them anymore, but using "npm uninstall apollo-angular" and "npm uninstall @apollo/client" only deletes the apollo-angular and @apollo/client folders. I want to clean up…
2
votes
1 answer

Typescript conditional type is now failing while using infer

Within our project, we are using the library apollo-angular. This library comes with predefined generic classes. One of these classes is called Query and takes two type parameters. These are its default values Query. API…
2
votes
1 answer

Apollo Angular GraphQL Code Generation. Generate Queries and Mutations from single schema.graphqls file

I'm currently trying to get the Apollo Angular Code Generation (see: https://the-guild.dev/graphql/codegen/docs/guides/angular) to create types, queries and mutations from a single schema.graphqls file. I'm using the same schema file as in the…
IdealOutage
  • 69
  • 1
  • 1
  • 11
2
votes
1 answer

how to configure the cache for mutations in apollo-angular?

After a mutation (create, update and delete) I need to update the list, so far the documentation is only for React, but BUT I need help to implement it in Angular 12, and the official documentation for angular is poor and seems almost a copy of the…
CaNa
  • 61
  • 2
2
votes
1 answer

How do you manage multiple graphql modules in Apollo-Angular?

At work we are building a large project that leverages libraries made by different teams. We are running into an issue with Apollo-Angular, in that when importing a single module with its own graphql module with APOLLO_NAMED_OPTIONS, it runs…
smkarber
  • 577
  • 5
  • 18
2
votes
1 answer

Integrating apollo-angular V2 with Angular V8

I am trying to integrate apollo-angular into my Angular project which uses Angular V8 but getting the following errors: The apollo-angular versions im using are the following ones: "@apollo/client": "^3.4.11", "apollo-angular": "^2.6.0", and…
Andres Hun
  • 21
  • 1
2
votes
1 answer

Apollo Angular failing to fetch data from GraphQL/MongoDB

I'm new to GraphQL and Angular and I'm trying to build a simple Angular component that uses GraphQL to fetch data from a mongoose database. I have the GraphQL Express server set up and it works fine in graphiql and Postman but the Angular…
1
2 3 4 5 6