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

Detect impossible to resolve validation rules #336

Open
spawnia opened this issue May 9, 2018 · 0 comments
Open

Detect impossible to resolve validation rules #336

spawnia opened this issue May 9, 2018 · 0 comments

Comments

@spawnia
Copy link

spawnia commented May 9, 2018

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']
            ],
        ];
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant