Skip to content

Return null from readQuery when data is not in store #1

@MaxDesiatov

Description

@MaxDesiatov

How to reproduce the issue:

const data = proxy.readQuery({query: gql`{ notInTheStore }`})

Intended outcome:

Returns null

Actual outcome:

Throws an error: ERROR Error: Uncaught (in promise): Error: Can't find field notInTheStore on object (ROOT_QUERY) undefined.

Migrated from:
apollographql/apollo-client#2007
apollographql/apollo-client#1542

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