Skip to content

Help: Unclear how to use validation "link" with mutation/input objects #1180

@joesaunderson

Description

@joesaunderson
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no
Version/Branch 1

I am trying to use the validation linking as documented here but I am struggling, and getting exceptions.

Mutation:

EntityMutation:
    type: object
    heirs:
        - Mutation
    config:
        fields:
            edit_Entity:
                type: "Entity!"
                args:
                    entityId:
                        type: "ID!"
                    set:
                        type: "EntityEditInput!"
                        validation: cascade
                resolve: '@=query("App/Resolver::editEntity", args)'

Input Object

EntityEditInput:
    type: input-object
    config:
        fields:
            displayName:
                type: "String"
                validation:
                    link: 'App\Entity::$Name'

Exception

Property Overblog\\GraphQLBundle\\Validator\\ValidationNode::$Name does not exist

I noted this was mentioned here but can you help me understand what the "correct" way of linking class constraints here would be (using an input object).

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