Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

Detect impossible to resolve validation rules #336

Open
@spawnia

Description

@spawnia

I found that validating for circular references within Input Objects is an ongoing issue within the specification project: graphql/graphql-spec#189

input Something {
  name: String
  somethingElse: Something!
}

I suppose we could take it for granted that illegal Input Object definitions will eventually be caught by the schema validation. Lee Byron already stated that he deems it necessary, the question here is just when that will happen.

However, i think we have to consider this from the perspective of laravel as well, since we have an additional layer of validation on top. The following example would be an Input Object definition with Laravel-based validation that cannot possibly work:

class ExampleValidationInputObject extends BaseType
{
    protected $inputObject = true;

    public function fields()
    {
        return [
            'self' => [
                'name' => 'self',
                'type' => GraphQL::type('ExampleValidationInputObject'),
                'rules' => ['required']
            ],
        ];
    }
}

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