Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GraphQL create item with relation should be checked against the update permissions not create #7237

@clck-dr

Description

@clck-dr

Preflight Checklist

Describe the Bug

Related to following discussion: #7185

I want ot create an item, let's say activity with a related activitytype via GraphQL API.

GraphQL throws Validation Exception becaus of missing create_activitytype_input fields (e.g. name). The activitytype with id 1 has allready been created and the request should use update_activitytype_input instead (mentioned by rijkvanzanten).

To Reproduce

POST /graphql

mutation {
    create_activity_item(
        data: {
            start: "2021-08-04T07:06:10Z"
            time: "00:01:11"
            calculatedpoints: 0
            activitytype: {
              id: 1
            } 
        },
    )     
}

What version of Directus are you using?

directus/directus:9.0.0-rc.85

What version of Node.js are you using?

directus/directus:9.0.0-rc.85

What database are you using?

mysql:5.7

What browser are you using?

Version 92.0.4515.131 (Offizieller Build) (64-Bit)

What operating system are you using?

Windows

How are you deploying Directus?

Docker

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions