Skip to content

Why does field access control on field makes its parent return null? #272

@Kocal

Description

@Kocal
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Version/Branch xxx

Hey, I encountered a problem on field access control.

So I got this schema:

Query: type: object config: fields: site: type: Site resolve: "@=resolver('site', [args])" access: "@=hasPermission(object, 'view')" args: id: type: "Int" Site: type: object config: fields: alpGroups: type: "[AlpGroup]!" resolve: "@=resolver('alp_groups_for_site', [value])" AlpGroup: type: object config: fields: id: type: Int! platform: type: Site! access: "@=hasPermission(object, 'view')"

The user has access to site and site.alpGroups, but he does not have access to site.alpGroups.X.platform.

Here is a small example of what the query can returns:
image

However, when I try to access site.alpGroups.X.platform, every values of data.site.alpGroups are null.
selection_539

Why does it not return something like below?
Did I misunderstand how field access works, or it's a bug?

{ "data": { "site": { "alpGroups": [ { "id": 1, "platform": null }, { "id": 2, "platform": null }, { "id": 3, "platform": null }, { "id": 4, "platform": null } ] } } } 

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions