isObjectType() public static method

public static isObjectType ( $type )
Esempio n. 1
0
 public function assetTypeHasField(AbstractType $objectType, AstFieldInterface $ast)
 {
     /** @var AbstractObjectType $objectType */
     if (!(TypeService::isObjectType($objectType) || TypeService::isInputObjectType($objectType)) || !$objectType->hasField($ast->getName())) {
         throw new ResolveException(sprintf('Field "%s" not found in type "%s"', $ast->getName(), $objectType->getNamedType()->getName()), $ast->getLocation());
     }
 }
Esempio n. 2
0
 private function isArrayOfObjectTypes($data)
 {
     if (!is_array($data) || !count($data)) {
         return false;
     }
     foreach ($data as $item) {
         if (!TypeService::isObjectType($item)) {
             return false;
         }
     }
     return true;
 }