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

testAvoidsRecursion() public method

public testAvoidsRecursion ( )
    public function testAvoidsRecursion()
    {
        $doc = '
      query Q {
        a
        ...Frag
        ...Frag
      }

      fragment Frag on DataType {
        a,
        ...Frag
      }
        ';
        $data = ['a' => 'b'];
        $ast = Parser::parse($doc);
        $schema = new Schema(['query' => new ObjectType(['name' => 'Type', 'fields' => ['a' => ['type' => Type::string()]]])]);
        $queryResult = Executor::execute($schema, $ast, $data, null, [], 'Q');
        $this->assertEquals(['data' => ['a' => 'b']], $queryResult->toArray());
    }