Tag: apollo
-
How to refetch all queries after a mutation?
0 Using apollo graphql, I have a mutation that modify the "Person" object in the database All throughout the app, I have various queries to fetch that from "Person". Sometimes I need the whole object, sometimes only the name or the age. There is a list of persons (generated using the PERSON_IDS query) and when…
-
Duplicate requests when using apollo client in electron.js
0 In electron.js I have basic component that has two useQuery hooks. When the component re-renders the hooks fire and should result in 2 calls in the network tab. However there are 3 or sometimes 4 requests. Looks like the apollo cache is not working. If remove one hook and fire the other one multiple…
-
Mutation validation ids in input for entities from another service. GraphQL Apollo Federation
0 I need to validate ids from mutation There’s example type Query @extends{ calendars( users: [Int] resources: [Int] workgraph_types: [Int] provide_services: Boolean date_from: String date_to: String paging: PagingInput ): CalendarList! @verifyResource } Need to validate ids for resources. I have resource in another microservice. I need to check that resource exists in another microservice. I…
-
Proceesing 2 queries graphql response that have same type into array
0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply {…
-
Proceesing 2 queries apollo graphql that have same type into 1 array
0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply {…
-
GraphQL iOS Apollo Client Automatic Persisted Queries Causing a Crash
1 Looking to get some help with setup of APQ’s on the iOS Apollo SDK, using version of Apollo 1.2.2 and when turned on the APQ as: let transport = RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: url, autoPersistQueries: true) Getting an error on query fetch as: Apollo/RequestBodyCreator.swift:47: Fatal error: To enable autoPersistQueries, Apollo types must be generated with…
-
can’t set members array in mongodb with prisma
0 I use Prisma, apollo-graphql, and Mongoose to create chat applications but I have this problem, MongoDB gets only _id when I try to create a chat. Prisma Schema: generator client { provider = "prisma-client-js" } datasource db { provider = "mongodb" url = env("DATABASE_URL") } model User { id String @id @default(auto()) @map("_id") @db.ObjectId…
-
Date and Json in type definition for graphql
60 Is it possible to have a define a field as Date or JSON in my graphql schema ? type Individual { id: Int name: String birthDate: Date token: JSON } actually the server is returning me an error saying : Type “Date” not found in document. at ASTDefinitionBuilder._resolveType (****node_modulesgraphqlutilitiesbuildASTSchema.js:134:11) And same error for JSON……
-
Importing “@authenticated” directive using nestjs, apollo, and code-first approach
0 I am using NestJS server with microservices and Apollo Router. I want to add "@authenticated" directive to my resolvers so I can omit authentication on requests to routes that do not require it. When using @Directive("@authenticated"), I get an error saying that I either have to use "@federation__authenticated" (which throws error saying it doesn’t…
-
Testing graphql query in react error: TypeError: (0 , _client.gql) is not a function
0 I have this graphql query: export const LOAD_PLAYERS = gql` query GetPlayers { players { id firstname lastname shortname sex picture { url } country { code picture { url } } stats { rank age weight height points } } } `; I’m using it in this custom hook and it works just…