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
1
vote
1 answer

ERROR in node_modules/apollo-angular/Apollo.d.ts(26,17)

I am working on Angular 7 project and the application is deployed in Azure App Services and Pipeline for the same in on Azure DevOps. It is basically CI/CD. Everything was fine, branch code merging (Code Integration) and deployment (Code Deployment…
1
vote
1 answer

authentication await in async setContext

In the docs ( https://www.apollographql.com/docs/angular/recipes/authentication/ ) there is an example. However this does not work, if you have a angular-apollo watch().valueChanges or fetch() as returned Observable... My code is: const auth =…
stroboshaver
  • 109
  • 1
  • 5
1
vote
2 answers

Use interfaces to build graphql query

is it possible to build graphql queries using existing interfaces? or we should write same code twice) for example in the doc we have interface Post { id: string; title: string; ... and then writing same fields in query query allPosts { …
Pasha K
  • 357
  • 1
  • 7
1
vote
0 answers

Universal apollo-client for Angualr, React, React-Native

Hi Stack Overflow community: I'm looking into building a library that talks to a GraphQL server, get some data and do some transformation. I have customers who wants to use this library, but they are using different JS framework/library - Angular,…
SDEZero
  • 363
  • 2
  • 13
1
vote
1 answer

Apollo client for angular: code generation from graphql files

I came to know about angular graphql code generator from here. I am trying to use it in my project to generate the graphql types and Query services for angular. My codegen.yml file looks like below. overwrite: true schema:…
1
vote
0 answers

UPLOAD Files with Apollo-angular GraphQL Mutation

I'm attempting to upload a file via a graphql mutation using the Angular Apollo library, but it's not working. Here is my GraphQL mutation: addAnomaly(params) { return this.apollo.mutate({ mutation: this.addAnomalyMutation, variables: { input:…
1
vote
1 answer

How To Implement apollo-link-error In Angular Module And In GraphQL Queries And Mutations?

I like this suggested global setup from the apollo-angular docs. I'm not sure about putting errorLink in options or if it should be grouped with httpLink. The big question is: How do I use this in my code? I can't find examples anywhere and I…
Preston
  • 3,260
  • 4
  • 37
  • 51
1
vote
0 answers

"Invariant Violation" after calling readQuery using apollo angular

I am just testing a simple case where I can add cats and show cat details. But I am getting this error bundle.esm.js:805 Invariant Violation: Can't find field color on object { "id": "5cf74600ed38a91e472e0e20", "name": "Rose", "breed":…
vicky shrestha
  • 147
  • 1
  • 11
1
vote
0 answers

ApolloTestingModule flush mutiple times for watchQuery

I need to test a service that uses apollo client to fetch some data. It uses watchQuery in order to keep an open stream of values. In the test I use ApolloTestingModule to flush the gql operation with test data. This works once, but I cannot test…
nest
  • 1,385
  • 1
  • 15
  • 34
1
vote
1 answer

Adding headers to apollo watchQuery gives data undefined

I am using apollo-angular package to query backend using graphQL. Everything works fine until I add headers to the query. I am adding custom header to get flattened data from the backend. When I add header to the query I get data as undefined.…
Amit Chigadani
  • 28,482
  • 13
  • 80
  • 98
1
vote
1 answer

Add User in Drupal8 using apollo angular GraphQL

I want to register a new user in Drupal8 backend. Installed graphql in drupal8 so its working as graphql server. Installed apollo in angular5 and successfully fetched nodes and articles list. Now I want to register a user in drupal8 using graphql…
Priya Agarwal
  • 433
  • 1
  • 4
  • 5
1
vote
0 answers

apollo-angular error // angular Project won't compile

When trying to compile a project in angular I get the following errors ERROR in node_modules/apollo-angular/Apollo.d.ts(1,100): error TS2305: Module '"/usr/app/node_modules/apollo-client/index"' has no exported member…
bobdolan
  • 563
  • 3
  • 9
  • 21
0
votes
1 answer

which version of apollo-angular is compatible with angular 13

I am trying top upgrade angular version to 13 from 12. I want to know which apollo-angular and apollo-client version are comptaible with angular 13. /// import { COMMON } from…
0
votes
0 answers

"Request header field apollographql-client-name is not allowed by Access-Control-Allow-Headers in preflight response" CORS issue using Apollo-client

`Getting CORS issue in Angular, for API calls because my portal(angular) and API's are deployed in two different host(domains). From Backend they don't restrict cross origins. Allow all origins, methods, headers, credentials and Age. From UI we was…
Ashok
  • 1
  • 4
0
votes
0 answers

Not Getting Data From Backend when I Use GraphQL Query from Angular

Login Function in my Component File logIn() { this._userServices .login(this.signInForm.value) .then((result: any) => { console.log('result', result); // localStorage.setItem('accessToken',…