You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both issue boiled down to same issue of having different definition of GraphQLError in graphql-jit library. If we have same definition of error class the issue seems to be resolved.
The text was updated successfully, but these errors were encountered:
I was able to work around this with the following code:
letres=awaitcompiledQuery.query(undefined,context,request.variables??{});if(isNotNil(res.errors)){res={
...res,errors: res.errors.map((error)=>{if(isNotNil(error.extensions)){returnerror;}// HACK: Recreate the error to fix the formatting, because// graphql-jit's error shape is non-standard.// https://github.com/zalando-incubator/graphql-jit/issues/234constnewError=newGraphQLError(error.message);Object.assign(newError,error);returnnewError;}),};}
This is obviously not great, we have to re-allocate the error every time (the Object.defineProperty usage makes it impossible to overwrite, so a copy is needed).
We are using
graphql-jit
with Apollo Server version 4(migrating from version 3). We are facing following explained issue.apollographql/apollo-server#7773
apollographql/apollo-server#7774
Both issue boiled down to same issue of having different definition of GraphQLError in
graphql-jit
library. If we have same definition of error class the issue seems to be resolved.The text was updated successfully, but these errors were encountered: