Skip to content

useMutation: Cannot read property '$root' of null #905

Open
@cloedu87

Description

@cloedu87

Describe the bug
A call of the function useMutation() throws an error
issue similar to this already solved issue with useSubscription()

To Reproduce
import { useMutation } ... in a component
call useMutation() in the setup() method of a vue component

Expected behavior
no error

Versions
vue: 2.6.10
vue-apollo: 3.0.2
apollo-client: 2.6.8

Additional context

TypeError: Cannot read property '$root' of null
    at getAppTracking (loadingTracking.js?b1f0:5)
    at getCurrentTracking (loadingTracking.js?b1f0:25)
    at track (loadingTracking.js?b1f0:50)
    at Object.trackMutation (loadingTracking.js?b1f0:70)
    at useMutation (useMutation.js?89f9:59)
    at _callee$ (useAuth.ts?0ae4:26)
    at tryCatch (runtime.js?96cf:45)
    at Generator.invoke [as _invoke] (runtime.js?96cf:271)
    at Generator.prototype.<computed> [as next] (runtime.js?96cf:97)
    at asyncGeneratorStep (asyncToGenerator.js?1da1:3)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions