Tag: error-handling
-
Apollo Client GraphQL error is lost / undefined after second time loading the page (refreshing the browser)
0 I am using Apollo Client in my Astro project. I have the following GraphQL query: const { data, loading, errors } = await client.query({ query: GET_PAGE, variables: { url: uri, }, errorPolicy: ‘all’, }); Also I defined my errorLink, based on the Apollo docs: const errorLink = onError(({ graphQLErrors, networkError }) => { if…
-
Can’t use extensions with GraphQLError
3 From the Apollo Graphql document, this way can define extension error: https://www.apollographql.com/docs/apollo-server/data/errors/ import { GraphQLError } from ‘graphql’; throw new GraphQLError(‘the error message’, extensions: { code: ‘SOMETHING_BAD_HAPPENED’, https: { status: 404, headers: new Map([ [‘some-header’, ‘it was bad’], [‘another-header’, ‘seriously’], ]), }, }, ); But in my case it got this error: Argument of…
-
Custom error status code with gqlgen + go gin
2 Recently I have been updating my GO REST APIs into graphQl API’s and I came across issue where I am unable to customise my status code with gqlgen. Response I got Headers Status Code: 200 OK { data: null, errors: [ {message: "Unauthorized access", path: ["…"]} ] } Expected Header Status Code: 401 UNAUTHORISED…
-
Catch apollo client errors when using errorLink
0 I’m using Apollo error link to handle graphQL errors. In most cases, I would only want to catch the error and show an alert, which is something I can easily to when defining onError, but in one of my views I’m running a mutation call and there I would like to catch the error…
-
Custom GraphQL exceptions
0 I’m trying to create a custom exception when GraphQL throws its owns. The default GraphQL exception response I got is (except for the fillings): { "errors": [ { "message": "Validation error of type WrongType: argument ‘inputLocals.localId’ with value ‘IntValue{value=7777800}’ is not a valid ‘Int’ – Expected value to be in the Integer range but…
-
Errors Does not include extension.category
0 i use… laravel v10.8 php 8.1 lighthouse v6.10 apollo-client 3.7.16 in lighthouse v5.41 we have extension that include category i was handle errors with this option… but in lighthouse v6.10 i can not get errors category how can i get it? laravel error-handling graphql laravel-lighthouse Share Follow asked 5 mins ago ali asghar sadat…
-
Cypress stub ‘ECONNREFUSED 127.0.0.1:3000’ error
0 I have a website that sends queries to the server using ‘Apollo graphql client’. I have set up an interface that will be displayed when this website cannot connect to the server, i.e. when it gets an error ‘Error: connect ECONNREFUSED’. I can test this manually by shutting down the server. I want to…