Skip to content

Server 2.0: Error: Cannot read property 'setCacheHint' of undefined #1201

@ovaris

Description

@ovaris

Hi,

trying to set cache programatically in my resolver, using latest apollo-server-express rc.0, the info parameter doesn't contain cacheControl:
Error: Cannot read property 'setCacheHint' of undefined

https://www.apollographql.com/docs/engine/caching.html#resolver-hints

items: (parent: any, args: any, context: any, { cacheControl }: any) => {
        cacheControl.setCacheHint({ maxAge: 60000 });
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions