GraphQL\Schema::getType PHP Method

getType() public method

public getType ( string $name ) : Type
$name string
return GraphQL\Type\Definition\Type
    public function getType($name)
    {
        $map = $this->getTypeMap();
        return isset($map[$name]) ? $map[$name] : null;
    }

Usage Example

Exemplo n.º 1
0
 public function testIncludesInterfaceSubtypesInTheTypeMap()
 {
     $someInterface = new InterfaceType(['name' => 'SomeInterface', 'fields' => []]);
     $someSubtype = new ObjectType(['name' => 'SomeSubtype', 'fields' => [], 'interfaces' => [$someInterface]]);
     $schema = new Schema($someInterface);
     $this->assertSame($someSubtype, $schema->getType('SomeSubtype'));
 }
All Usage Examples Of GraphQL\Schema::getType