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
There's some difference in building test schemas vs building real schemas which results in an error when building the below schema in tests which is perfectly fine and valid with normal runtime execution. This discrepancy is making it impossible to test #538 and could mean we are getting some false positives in existing tests.
Steps to reproduce
Create the following models.yml file in both vendor/silverstripe/graphql/tests/Schema/_testRecursiveSortSchemaCanBuild/models.yml and app/_graphql/models.yml:
Add this method in vendor/silverstripe/graphql/tests/Schema/IntegrationTest.php:
publicfunctiontestRecursiveSortSchemaCanBuild()
{
// We're just testing that there's no exception on schema generation.$this->expectNotToPerformAssertions();
$dir = '_' . __FUNCTION__;
$this->createSchema(newTestSchemaBuilder([$dir]));
}
Finally, compare the results of running sake dev/graphql/build (which will run fine without any errors) vs running the new test method via PHPUnit.
The PHPUnit test will fail with this exception:
SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException: Failed to apply plugin SilverStripe\GraphQL\Schema\DataObject\Plugin\QuerySort to readPermissions. Got error "Could not find field "id" on type "PermissionConnection". If it is a custom filter field, you will need to provide a resolver function in the "resolver" config for that field along with an explicit type."
The text was updated successfully, but these errors were encountered:
There's some difference in building test schemas vs building real schemas which results in an error when building the below schema in tests which is perfectly fine and valid with normal runtime execution. This discrepancy is making it impossible to test #538 and could mean we are getting some false positives in existing tests.
Steps to reproduce
Create the following
models.yml
file in bothvendor/silverstripe/graphql/tests/Schema/_testRecursiveSortSchemaCanBuild/models.yml
andapp/_graphql/models.yml
:Add this config to
app/_config/graphql.yml
:Add this method in
vendor/silverstripe/graphql/tests/Schema/IntegrationTest.php
:Finally, compare the results of running
sake dev/graphql/build
(which will run fine without any errors) vs running the new test method via PHPUnit.The PHPUnit test will fail with this exception:
The text was updated successfully, but these errors were encountered: