GraphQL\Tests\Executor\ExecutorTest::testUsesTheOnlyOperationIfNoOperationIsProvided PHP Method

testUsesTheOnlyOperationIfNoOperationIsProvided() public method

    public function testUsesTheOnlyOperationIfNoOperationIsProvided()
    {
        $doc = 'query Example { a }';
        $data = ['a' => 'b'];
        $ast = Parser::parse($doc);
        $schema = new Schema(['query' => new ObjectType(['name' => 'Type', 'fields' => ['a' => ['type' => Type::string()]]])]);
        $ex = Executor::execute($schema, $ast, $data);
        $this->assertEquals(['data' => ['a' => 'b']], $ex->toArray());
    }