Tag: apollo-client
-
Get Result from apollo client error undefined
0 I’m trying to use the result I’m getting from my apollo client. but it keeps giving me error of undefined although the request send was success in network. It means I cannot get access to the result like normal! the code in my store is: async questionSearch({ commit }, data) { const ALL_QUESTION_SEARCH =…
-
How to set initialState using Redux Toolkit with data using Apollo’s useQuery?
0 I am trying to call the useQuery hook (something not allowed outside of functional components), in a redux toolkit slice. Is this something that is doable, perhaps using createAsyncThunk or some similar method? My application is built with the MERN stack, so my database is MongoDB, and I’m using Graphql to fetch the data.…
-
With Apollo Graphql, is it the same having a field as null and not sending it?
0 I am implementing a React Typescript app that communicates to a Kotlin backend using GraphQL (Apollo on the Frontend). My mutation is : updateProfile(input: UpdateProfileInput) input UpdateProfileInput { firstName: String lastName: String email: String } I am supposed to send as an input only the fields that have been changed. So I should not…
-
How to add header in Apollo GraphQL : iOS
19 Hy I am working in a project with Apollo GraphQL method and its working fine. But now the client required for adding additional header with Apollo API’s. But after adding the header the API’s response return as unAuthorized. I am adding the header as, let apolloAuth: ApolloClient = { let configuration = URLSessionConfiguration.default //…
-
Pass GraphQL Header from request to subsequent Axios Request
0 I have an Angular application which is using Apollo Client for querying a GraphQL Server from a NestJS application. This NestJS application is executing a request through Axios to an external Backend. How could be passed the client header set in all the GraphQL requests to the backend request through Axios? Apollo Client GraphQL…
-
React Native Navigation stack screen mix up
0 There’s some logic issue with my stack when I’m trying to login and logout. I’m currently storing a token using AsyncStorage, however, it seems to be a problem of going into another navigation stack and I’m not quite understanding it. I have verified that the token is showing up as intended and being wiped…
-
Why I got error: Cannot query field xx on type “Query”?
57 Although I copied and pasted the graphQL query from the GraphiQL tool after I tested it at GraphiQL successfully , the query returned with an error when I tried it in Apollo client within a reactJS app: [GraphQL error]: Message: Cannot query field “allStudents” on type “Query”., Location: [object Object], Path: undefined Here is…
-
How to make the ApolloClient useQuery method to await
0 const claimableItemId = "5ab7c5ab-7a3d-4a92-a62f-2fbd995955f6"; const destAddr = "0x387961b46242A42B445D4354d5048329410613a7"; const [redeemEarnableItem, { data: redeemItem }] = useMutation( REDEEM_EARNABLE_ITEM, { variables: { claimableItemId, destAddr, }, } ); const [getInvoiceDetails, { loading, data: invoiceDetails, refetch }] = useQuery(GET_INVOICE_DETAILS); const redeemHandler = async () => { try { const redeemItem = await redeemEarnableItem(); const id = redeemItem.data.redeemEarnableItem.invoiceID; console.log(id,…
-
GraphQL only select items of certain type from array
0 In my GraphQL API I have defined a course fragment with an array property lessons. Initially it only had lessons of type TextLesson. Later we added lessons of type VideoLesson as well. fragment TextLessonFields on TextLesson { title body } #fragment VideoLessonFields on VideoLesson { # title # videoUrl #} fragment CourseFields on Course…