Skip to content

@canResolved directive action ignored when batchload_relations enabled #2758

@kirills-morozovs

Description

@kirills-morozovs

Description

When batchload_relations enabled in config file, and @canResolved is used for a relation the action: RETURN_VALUE will be ignored.

Expected behavior/Solution

When model's policy returns false and action = RETURN_VALUE, is set to null expectation is that it will return null instead of the This action is unauthorised

Steps to reproduce

GraphQL:

type User {
    book: Book @belongsTo @canResolved(ability: "view", action: RETURN_VALUE, returnValue: null)
}

type Query {
    users(): [User] @canResolved(ability: "view") @paginate
}

Lighthouse Version

v6.65.0

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