Newest 'apollo-angular' Questions - Stack Overflow

Questions tagged [apollo-angular]

The `apollo-angular` tag should be used for 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

0
votes
0answers
22 views

Apollo GraphQL Testing

I'm new to Apollo GraphQL testing, and I've created my first test, you can see it below. find-trip.spec.ts import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ...
0
votes
0answers
3 views

How can we delete particular data object from local store after mutation using apollo angular

I just want to remove particular data object from the store after mutation using apollo angular, any Idea how can I achieve that?
0
votes
0answers
35 views

“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": "...
1
vote
0answers
14 views

Why does ApolloTestingModule in Angular spec file with jest throw: "Cannot read property 'use' of undefined?

I am trying to combine Angular, Jest and Apollo. My Spec file follows the structure described in the documentation here. When I run only jest like this: jest --watchAll everything works. But if I ...
0
votes
0answers
11 views

ApolloTestingModule for ApolloClientOptions dependency injected via useFactory option

I setup apollo-angular as follows: @NgModule({ exports: [ApolloModule, HttpLinkModule], providers: [ { provide: APOLLO_OPTIONS, useFactory: prepareApolloClientOptions, deps: ...
0
votes
0answers
21 views

When watchQuery().valueChanges callback is triggered? (Maximum call stack size exceeded error)

I fetch a list of users this.apollo.watchQuery<any>({ query: this.getAllQuery }) .valueChanges.subscribe(users => this.users = users); then the list is rendered somewhere. When ...
0
votes
1answer
34 views

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 }...
0
votes
1answer
16 views

Why am I missing types on Apollo-angular mutation?

I am trying to understand the Apollo client in an Angular client. The following code gives me no typings: fireMutation() { this.apollo.mutate<{foo: string}>({ mutation: gql`some mutation {...
0
votes
1answer
21 views

How to change Method type of API in apollo-angular

I am using Apollo angular client to call API in angular my some API's are POST type and some are GET type and I want to change API method type as per API(GET or POST) I am new with this so please ...
0
votes
0answers
10 views

separate service for each query vs feature queries in one service

I can't understand why should I use dedicated service for each query type. But with this approach I would have to create a service just for one query and I don't like doing this, as I will then have ...
1
vote
0answers
18 views

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 ...
2
votes
0answers
60 views

Apollo Angular not sending request

I have a simple query (Apollo-Angular Client) to fetch some data from an GraphQL server public getQuestionBank(courseCode: string): Observable<ApolloQueryResult<{}>> { const query = ...
0
votes
1answer
205 views

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 ...
0
votes
0answers
50 views

Apollo Angular: SwitchMap operator is not working after mutation

I'm using Apollo Angular (GraphQL) to manage a list of posts but the switchMap operator is not working properly when I pipe this operator to a mutation. When I delete one item from my list of posts I ...
1
vote
0answers
40 views

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 ...
0
votes
0answers
23 views

Apollo angular refetchquery finished emit

I got myself into the situation similar to this example project: https://stackblitz.com/edit/simple-apollo-angular-example-nablij?file=app%2Fupvoter.component.ts I would like to show the loading ...
0
votes
0answers
63 views

apollo angular CachePersistor

I am stuck with apollo cachepersitor, i get error that local storage is full even after following apollos official tutorial and suggestions on stackoverflow which suggest i include a maxSize. The ...
1
vote
0answers
207 views

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": "...
0
votes
0answers
24 views

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 ...
0
votes
0answers
52 views

apollo angular - Network error:undefined because the correct enpoint hasn't been set

I just duplicated from another project our apollo angular setup where we initialize Apollo after we get a response from our server following a successful login. @Effect({ dispatch: true }) ...
0
votes
0answers
112 views

Unit testing apollo-angular graphql

Has anyone succeeded testing an apollo server with apollo-angular?. Here is my small setup: import { ApolloModule } from 'apollo-angular'; import { ApolloTestingModule } from 'apollo-angular/testing';...
0
votes
0answers
130 views

apollo client - “attempted to write an object with no provided id error with” a query

I use apollo client in an angular application. The query is like this. Note that fkElectricityTypeId is null in the database when isProduction = false. query GetTurnoversBySmartMeterId($id: UUID!, $...
0
votes
1answer
194 views

Why isn't apollo calling my cacheRedirect for this query?

Using apollo-angular, I have an apollo InMemoryCache like so new InMemoryCache({ // ... stuff cacheRedirects: { Query: { form: (_, args, { getCacheKey }) => { console.log('...