GraphQL\Type\Definition\UnionType::isPossibleType PHP 메소드

isPossibleType() 공개 메소드

public isPossibleType ( Type $type ) : mixed
$type Type
리턴 mixed
    public function isPossibleType(Type $type)
    {
        if (!$type instanceof ObjectType) {
            return false;
        }
        if (null === $this->possibleTypeNames) {
            $this->possibleTypeNames = [];
            foreach ($this->getTypes() as $possibleType) {
                $this->possibleTypeNames[$possibleType->name] = true;
            }
        }
        return isset($this->possibleTypeNames[$type->name]);
    }