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

ng add apollo-angular: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

npm install --legacy-peer-deps does not fix the problem CLI breaks when setting up apollo-angular and if I try manually I get the same error. Tried it on a new project and it still didn't work. Has you can see in the steps below: ng new…
Royer Adames
  • 868
  • 9
  • 13
0
votes
1 answer

Sending multipart/form-data using GraphQL API in .NetCore

I'm trying to upload the user avatar of .png/jpeg/.jpg file types from angular client to .netCore server application using GraphQL API. I managed to send the image to be uploaded in a request of content type multipart/form-data from client-side. But…
0
votes
1 answer

update model in graphQL giving fields to update and array of id's

I have a problem. I want to create query to update some fileds on multiple model, it should looks like this: mutation{ updateInternalOrder( input: { state: { connect: 1 } id_internal_orders: [1,2] <= here …
burasuk
  • 162
  • 2
  • 8
0
votes
0 answers

How to upload an image to apollo-server from apollo-angular using graphql-codegen?

This is my receiver in the server. @Mutation(() => String) async register( @Arg("picture", () => GraphQLUpload) { createReadStream, filename }: any ): Promise { console.log(__dirname); try { const promise = await…
S. Karki
  • 419
  • 3
  • 14
0
votes
1 answer

how can i use async pipe when I'm using graphql queries?

I have an angular project and in my component, I fetch data with graphql and in HTML I show an image of the result. but for a moment, I get this error in the console: ERROR TypeError: Cannot read property 'image' of undefined this is my html…
fariba.j
  • 1,737
  • 7
  • 23
  • 42
0
votes
1 answer

Apollo server file upload from apollo angular

I am trying to upload a file from Angular using apollo-angular to apollo server but the documentation is confusing and the information i found in genera is not updated to latest versions of apollo angular and apollo server. In the front end i…
0
votes
1 answer

apollo-angular throws Error when using a mockError on Jasmine/Karma testing

I've tested errors on queries/mutations like these for years, but just now, I got one error I can't seem to figure it out. When I call this test, Apollo is throwing an error for the errorMock I've made. Has anyone ever got this error? It's funny…
0
votes
0 answers

GraphQL Angular Apollo Client - Query with dynamic fields based on the checkbox value from the HTML

Below is the angular HTML and component logic, the 'doGetQuerySpecific()' method is called from html on click of 'Submit' on a form which has two checkboxes. I need to map these checkbox logic to the GQL query like shown in the component code. The…
0
votes
1 answer

Apollo gql : How do I handle bundled queries when one works and one fails?

We are using Apollo Angular Client to call an Apollo Server. I am grouping together two queries. One of them fails. On the server side, one of the resolvers throws an error. throw new UserInputError("ERR_MSG", { "message":"addtional info"}) How am…
0
votes
2 answers

Two endpoints in Apollo Client (Angular)

Beginer here. While using a single endpoint using the default structure made when executing "ng add apollo-angular" works fine, when adding a second one using APOLLO_NAMED_OPTIONS I get two cryptic errors messages. What could be going wrong? This is…
0
votes
0 answers

TypeError: Cannot assign to read only property of object

I have an angular application which has a form. I have my backend APIs written in Graphql. I am fetching data using Apollo Angular library to populate the fields within the form (which uses ngModel for binding) for my application user. I have given…
Neha Soni
  • 1
  • 2
0
votes
1 answer

Getting "object is not extensible" when trying to add fields to result gql data objects after upgrading to Apollo client 2

When getting results from the server, usually I'm adding extra fields to the object in my Apollo Angular client, for convenience usage later on, like this: this.apollo.watchQuery({query: gql`...`}) .valueChanges.pipe( map(result => { …
0
votes
1 answer

Why is apollo-angular Query returning empty array?

I recently installed and setup apollo-angular, and am having trouble getting data from a query. I've referred to other questions that dealt with similar issues, but they weren't helpful. What I'm certain of is: I've successfully tested a query, so…
Michael C
  • 339
  • 4
  • 19
0
votes
0 answers

Having trouble in fetching existing api (anilist api) via apollo-angular

I am trying to fetch data from anilist api (https://github.com/AniList/ApiV2-GraphQL-Docs) via apollo-angular. Connection seems to be developed but not able to get data on client side. I need help. If someone know how to solve it. Code is here…
0
votes
1 answer

Strategy handling and invalidating cached data on subscriptions in a moderately complex usecase

Let's take a chat application for example. A user has access to multiple chat threads, each with multiple messages. The user interface consists of a list of threads on the left side (listThreads) that contains the name of the other party, the last…
Ákos Vandra-Meyer
  • 1,890
  • 1
  • 23
  • 40