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

Prisma returning an array containing objects

I'm using Apollo Server and Prisma to query my graphQL server: I have this resolver: const resolvers = { Query: { sessions: async () => { const allSessions = await prisma.session.findMany() console.log(allSessions) return…
Peter Boomsma
  • 8,851
  • 16
  • 93
  • 185
0
votes
0 answers

Entity graph relations with Apollo Angular cache

Consider I have a simple graph representing many to many relation with relation table. Person[id,name] <-- Permission[id,person_id,team_id,permission_string] --> Team[id,name] So basically any person can have multiple permissions regarding any…
Ernio
  • 948
  • 10
  • 25
0
votes
0 answers

Hasura WebSocket connection to 'wss://XXX.XXX.XXX.XXX/v1/graphql' failed: WebSocket is closed before the connection is established

This error message will appear when the system is connecting, but sometimes it is good and sometimes it is abnormal. I use Angular & apollo-angular to connect. const ws = new WebSocketLink({ uri:'wss://XXX.XXX.XXX.XXX/v1/graphql', …
Bryant
  • 1
  • 1
0
votes
0 answers

Unable to fetch schema from Graphql Server using Angular Apollo Codegen

I've build a test angular app that I want to try Apollo graph with, particularly apollo graph codegen feature. I've followed instructions to the tee on the Apollo site: Apollo Angular -…
Aeseir
  • 7,754
  • 10
  • 58
  • 107
0
votes
1 answer

How to know if user is logged in Angular

I have an Angular web application who makes requests to a GraphQL API through Apollo Client. I want to guard my angular routes based in the user login status. When a user logs in, receives a cookie from the server with 2 hours expiration limit. I…
0
votes
1 answer

Angular doesn't retrieve information from Apollo GraphQL Server

I've been struggling for hours in order to get my Angular component work with retrieving data from an Apollo GraphQL server by a simple Query (PingGQLService). I'm using apollo-angular 4.1.0 and @apollo/client 3.0.0, even tried with…
0
votes
1 answer

Why browser cancels HTTP POST requests when its not a duplicate request?

I am working with Angular10. Calling GraphQL queries. When I call the same GraphQL query multiple times with different POST data all the API calls gets canceled except the last one. But I want all the APIs needs to be called. Having this Config in…
Gnik
  • 7,120
  • 20
  • 79
  • 129
0
votes
0 answers

apollo-angular - Get an error "Cannot read properties of undefined (reading 'query')" when load the module by module federation

Hi (posted also as an issue at apollo-angular but there is no response for a long time) I'm using @angular-architects/module-federation to split the code into micro frontends and I'm trying to use typescript-apollo-angular for autogenerating code…
0
votes
2 answers

how can I install apollo-angular on angular 14?

I have this error while testing apollo-angular on angular 14 Error: node_modules/apollo-angular/types.d.ts:11:54 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members. 11 export…
san
  • 7
  • 3
0
votes
0 answers

Apollo-Angular-PrimeNG: error TS2740: Type 'Observable<{[ ]>' is missing the following properties from type 'any[]':length,pop,push,concat,and 28 more

Hi) I'm trying to request data from a server using Apollo-Angular with codegen and display that data in a DataView table from PrimeNg. Type mismatch error. Somewhere, the any type is probably expected, but where? Should I use the interface as stated…
0
votes
0 answers

Error in unit test in service of my angular apollo application

I am unit testing my angular apollo app. I always get the same error: Error: Expected one matching operation for criteria "Match DocumentNode", found none. at ApolloTestingBackend.expectOne…
Esther_5
  • 151
  • 2
  • 10
0
votes
0 answers

How to do apollo-angular service testing in angular

I want to unit test a typescript function that uses apollo/graphql. I have tried several examples that I have found around here, but none of them work for me. Given my zero experience testing, from the following simple example, could you give me a…
Esther_5
  • 151
  • 2
  • 10
0
votes
1 answer

How can I add API key to Apollo-Angular to fetch data from mongodb realm GraphQL API

I am using MongoDB realm GraphQL API to access data. I am using Apollo-Angular. The GraphQL API needs an API key to access the data. I tried with the postman and it work. Using the postman post request I pass the key in the Authorization that added…
monzim
  • 526
  • 2
  • 4
  • 13
0
votes
1 answer

Angular Apollo V3 - Jest error: Cannot find module 'apollo-angular'

I recently updated angular apollo from 2.6.0 to the v3.0.0 and this update broke my tests. I am using jest for my unit tests, while the app compiles and runs fine, my tests are unable to import any dependency from 'apollo-angular', and I get errors…
Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
0
votes
1 answer

How can I use fragments with apollo-angular

I use Angular 13 and apollo-angular 3.0.0. I have the codes to make GraphQL query: const GET_TODOS = gql` query GetTodos() { todos() { id title brief body tags created_at updated_at author { …
Rocketk
  • 11
  • 1