GraphQL\Tests\Executor\NonNullTest::testNullsTheTopLevelIfSyncNonNullableFieldThrows PHP Method

testNullsTheTopLevelIfSyncNonNullableFieldThrows() public method

    public function testNullsTheTopLevelIfSyncNonNullableFieldThrows()
    {
        $doc = '
      query Q { nonNullSync }
        ';
        $expected = ['data' => null, 'errors' => [FormattedError::create($this->nonNullSyncError->getMessage(), [new SourceLocation(2, 17)])]];
        $actual = Executor::execute($this->schema, Parser::parse($doc), $this->throwingData)->toArray();
        $this->assertArraySubset($expected, $actual);
    }