Skip to content

Unable to stringify context to JSON #12

@chidimo

Description

@chidimo

First of all, thanks for the detailed tutorial on codeburst

But I'm experiencing a major issue with stringifying context when working with offline mutations. This happens on line 16 in the file src/utils/trackerLink.ts. This line throws an error about not being about circular dependency. When I console logged the context I found that it had lots of properties and methods, of which I can't know exactly what is causing the problem.

const context = operation.getContext();
const contextJSON = JSON.stringify(context); // this fails with Unhandled Rejection (Error): Converting circular structure to JSON

I'm working with apollo-client 3.1.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions