Youshido\GraphQL\Type\TypeService::isInterface PHP Method

isInterface() public static method

public static isInterface ( AbstractType | mixed $type ) : boolean
$type AbstractType | mixed
return boolean
    public static function isInterface($type)
    {
        if (!is_object($type)) {
            return false;
        }
        return $type->getKind() == TypeMap::KIND_INTERFACE;
    }

Usage Example

Example #1
0
 public function testTypeService()
 {
     $this->assertTrue(TypeService::isScalarType(TypeMap::TYPE_STRING));
     $this->assertFalse(TypeService::isScalarType('gibberish'));
     $this->assertFalse(TypeService::isScalarType(new TestObjectType()));
     $stringType = new StringType();
     $this->assertFalse(TypeService::isInterface($stringType));
     $this->assertEquals(TypeService::resolveNamedType($stringType), $stringType);
     $this->assertNull(TypeService::resolveNamedType(null));
     $this->assertEquals(TypeService::resolveNamedType(123), $stringType);
 }
All Usage Examples Of Youshido\GraphQL\Type\TypeService::isInterface