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
0
votes
0 answers

GraphQL Requiring Multiple Variables Not Working Properly with Angular-Apollo

I'll start off by saying, I have been struggling for longer than my pride wants to admit and have put off asking, because I'm not sure how clear I will be; but, here goes . . . I am using Angular 9 with Apollo-Angular and have no trouble accessing…
Briana Finney
  • 1,171
  • 5
  • 12
  • 22
0
votes
0 answers

"ApolloError: Network error" in SSR Angular Universal, apollo-angular app

Every time I fetch data in component by apollo-angular in builded app, error below pop up and crash it. I don't really know what's that error mean. When I tried to get more info about it but its doesn't show anything more. ERROR ApolloError: Network…
PreQ
  • 1
  • 2
0
votes
1 answer

Apollo Angular watchQuery returns no results or errors

I decided to wrap up the GraphQLModule that is created by ng add apollo-angular into our own Angular Shared Module. https://www.apollographql.com/docs/angular/basics/setup/#installation-with-angular-schematics While performing queries inside of…
Vippy
  • 1,356
  • 3
  • 20
  • 30
0
votes
1 answer

Angular Apollo inject URI into graphql.module.ts

I am in the process of making an Angular library that includes auth/graphql related code that all our apps require. Issue is, I store the uri in an Angular environment variable, which do not exist in an Angular libraries. Performing an ng add…
Vippy
  • 1,356
  • 3
  • 20
  • 30
0
votes
0 answers

Apollo watchQuery method ignores passed variables

I'm using angular-apollo lib to call backend graphql. I want to reuse my queries generated by gql function. It means I need to use variables, but when I write query like this: this.apollo.watchQuery({ query: gql` { …
Dzmitry Atkayey
  • 332
  • 5
  • 12
0
votes
0 answers

How to reuse GQL queries?

Imagine that I have this "Schema": type User { id: ID! name: String! } Now, in one of my components (A) I need the user id; and in another component (B) I need the user id and the user name. What I'm doing now is to make a User query in A…
Daniel Heras
  • 33
  • 1
  • 5
0
votes
1 answer

Is it possible to reset the cache using ApolloTestingModule?

I have a component that uses the Apollo Angular client to fetch some data. I'm trying to write tests for it to check how it responds to different types of data. However there does seem to be a way to change the response data after the first time…
joshhunt
  • 5,197
  • 4
  • 37
  • 60
0
votes
1 answer

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 {}`, variables: {} }).subscribe(v => { // No…
DauleDK
  • 3,313
  • 11
  • 55
  • 98
0
votes
1 answer

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 help me. my code : export class AppModule { …
VIVEK
  • 257
  • 1
  • 5
  • 18
0
votes
1 answer

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('cache key', [args, getCacheKey({ __typename: 'Form',…
John
  • 9,249
  • 5
  • 44
  • 76
1 2 3 4 5
6