Skip to content

Live resolvers: return value when throw #4877

@pavelglac

Description

@pavelglac

Return value when resolvers throw

Based on the docs :

If an individual resolver throws an error, when that field is read, Relay will log that error to the environment's user-provided relayFieldLogger logger, and the field will become null.

I am assuming the return value for resolvers should be null instead of the current undefined. However, tests for react-relay mark undefined as the expected value.

The fix would be to also save the return value from evaluation in LiveResolverCache.js
and not only the snapshot and error.

PR with suggested changes: #4876

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions