Skip to content

"Invariant Violation: Expecting a parsed GraphQL document" Error when using query option #912

Open
@locent217

Description

@locent217

I am using the query option to make the stool query to run if only view_stool is true. here's the code:

apollo: {
stool: {
    query () {
        // Here you can access the component instance with 'this'
        if (this.view_stool === true) {
            return stoolQuery
        }
    },

    variables () {
        return {
            id: this.stool_id
        }
    },

    update (data) {
        this.stool.name = data.stool.name
        this.stool.stool_owner = data.stool.stool_owners.name
        this.stool.stool_type = data.stool.stool_type
        this.stool.date_of_ownership = data.stool.date_of_ownership
        this.stool.rental_per_month = data.stool.rental_per_month
        this.stool.remarks = data.stool.remarks
        this.stool.address = data.stool.address
        this.stool_payments = data.stool.stool_payments
        this.view_stool_dialog = true
        this.view_stool = false
    },

    fetchPolicy: 'network-only'
}
}

Everytime it runs it shows the error but the query is working fine. it just shows the error. Can someone tell me if I have made a mistake?

NOTE: the stoolQuery is a gql file.

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