Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'originalError' in type 'ApolloError' is not assignable to the same property in base type 'GraphQLError'. #5843

Closed
woltob opened this issue Oct 27, 2021 · 2 comments

Comments

@woltob
Copy link

woltob commented Oct 27, 2021

Before going into more detail here:

I am receiving now the error that there is a mismatch between two types:

Namely, in node_modules/apollo-server-errors/dist/index.d.ts:10:5 Apollo Error implements GraphQLError.

export declare class ApolloError extends Error implements GraphQLError {
    extensions: Record<string, any>;
    readonly name: string;
    readonly locations: ReadonlyArray<SourceLocation> | undefined;
    readonly path: ReadonlyArray<string | number> | undefined;
    readonly source: Source | undefined;
    readonly positions: ReadonlyArray<number> | undefined;
    readonly nodes: ReadonlyArray<ASTNode> | undefined;
    originalError: Error | null | undefined;
    [key: string]: any;
    constructor(message: string, code?: string, extensions?: Record<string, any>);
}

whereas GraphQL Error is defined as such:

export class GraphQLError extends Error {
  constructor(
    message: string,
    nodes?: Maybe<ReadonlyArray<ASTNode> | ASTNode>,
    source?: Maybe<Source>,
    positions?: Maybe<ReadonlyArray<number>>,
    path?: Maybe<ReadonlyArray<string | number>>,
    originalError?: Maybe<Error>,
    extensions?: Maybe<GraphQLErrorExtensions>,
  );
...

As of now, we cannot proceed with using our Backend, also downgrading to what it previously was seems not to be the solution.

Please fix this asap. Thank you very much.
I'll open a pull request for this as well.

IvanGoncharov added a commit to graphql/graphql-js that referenced this issue Oct 27, 2021
Partial revert of #3333
Were reverted due to conflict with Apollo Server, see
apollographql/apollo-server#5843
IvanGoncharov added a commit to graphql/graphql-js that referenced this issue Oct 27, 2021
Fix #3340
Partial revert of #3333
Were reverted due to conflict with Apollo Server, see
apollographql/apollo-server#5843
@IvanGoncharov
Copy link
Member

IvanGoncharov commented Oct 27, 2021

@charles-hill-work
Copy link

FYI: This problem also effects graphql 16.x. I've already notified IvanGoncharov in that repo's ticket.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants