You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latter validation could be performed during build-step or when running CLI commands. It will be disabled by default, same as current config validation.
The text was updated successfully, but these errors were encountered:
In the v0.10.0 version, we do have Schema validation (based on assertions). GraphQL\Type\Definition\Config is deprecated, so following should be used instead:
$schema = newSchema([/* my opts */]);
$schema->assertValid(); // this will throw GraphQL\Error\InvariantViolation on errors
Method assertValidshould not be used in production environment (because it is expensive) but can be useful during build step or in CLI commands to make sure Schema is defined correctly.
At present we do only very shallow validation of schema types, fields and arguments because of performance considerations.
There is also config validation which is unfortunately too limited because it cannot validate fields defined using
Closure
.New schema validation should be split into two steps:
The latter validation could be performed during build-step or when running CLI commands. It will be disabled by default, same as current config validation.
The text was updated successfully, but these errors were encountered: