Skip to content

SmartQuery error() handler gets called twice even though query was retrieved once from the network #1133

Closed
@fabis94

Description

@fabis94

Describe the bug
For some reason error() handler of my query gets called twice, once as an Error and the 2nd time as a GraphQLError. The query results definitely aren't in a cache or anything, so why does this happen?

To Reproduce
Nothing special, the query is registered like this:

apollo: {
        failingQuery: {
            query: failingQuery,
            error(err) {
                alert(err.message);
            }
        }
    },

And the alert is invoked twice.

Expected behavior
The handler should be called once, why would it be called twice?

Versions
vue: 2.6.11
@vue/apollo-option: 4.0.0-alpha.11 and also 3.x
apollo-client: 3.3.6

Additional context
No special setup is done here, it's a basic query that hasn't been cached

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions