當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Type::resolve方法代碼示例

本文整理匯總了PHP中GraphQL\Type\Definition\Type::resolve方法的典型用法代碼示例。如果您正苦於以下問題:PHP Type::resolve方法的具體用法?PHP Type::resolve怎麽用?PHP Type::resolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GraphQL\Type\Definition\Type的用法示例。


在下文中一共展示了Type::resolve方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getType

 public function getType()
 {
     if (null === $this->resolvedType) {
         $this->resolvedType = Type::resolve($this->type);
     }
     return $this->resolvedType;
 }
開發者ID:andytruong,項目名稱:graphql-php,代碼行數:7,代碼來源:FieldArgument.php

示例2: getTypes

 /**
  * @return ObjectType[]
  */
 public function getTypes()
 {
     if (null === $this->types) {
         if ($this->config['types'] instanceof \Closure) {
             $types = call_user_func($this->config['types']);
         } else {
             $types = $this->config['types'];
         }
         Utils::invariant(is_array($types), 'Option "types" of union "%s" is expected to return array of types (or closure returning array of types)', $this->name);
         $this->types = [];
         foreach ($types as $type) {
             $this->types[] = Type::resolve($type);
         }
     }
     return $this->types;
 }
開發者ID:webonyx,項目名稱:graphql-php,代碼行數:19,代碼來源:UnionType.php

示例3: getWrappedType

 /**
  * @param bool $recurse
  * @return mixed
  */
 public function getWrappedType($recurse = false)
 {
     $type = Type::resolve($this->ofType);
     return $recurse && $type instanceof WrappingType ? $type->getWrappedType($recurse) : $type;
 }
開發者ID:jmcclell,項目名稱:graphql-php,代碼行數:9,代碼來源:ListOfType.php

示例4: getWrappedType

 /**
  * @return Type
  */
 public function getWrappedType()
 {
     return Type::resolve($this->ofType);
 }
開發者ID:andytruong,項目名稱:graphql-php,代碼行數:7,代碼來源:ListOfType.php

示例5: getWrappedType

 /**
  * @param bool $recurse
  * @return mixed
  * @throws \Exception
  */
 public function getWrappedType($recurse = false)
 {
     $type = Type::resolve($this->ofType);
     Utils::invariant(!$type instanceof NonNull, 'Cannot nest NonNull inside NonNull');
     return $recurse && $type instanceof WrappingType ? $type->getWrappedType($recurse) : $type;
 }
開發者ID:aeshion,項目名稱:ZeroPHP,代碼行數:11,代碼來源:NonNull.php

示例6: getType

 /**
  * @return Type
  */
 public function getType()
 {
     if (null === $this->resolvedType) {
         // TODO: deprecate types as callbacks - instead just allow field definitions to be callbacks
         $this->resolvedType = Type::resolve($this->type);
     }
     return $this->resolvedType;
 }
開發者ID:joaqtor,項目名稱:graphql-php,代碼行數:11,代碼來源:FieldDefinition.php

示例7: getType

 public function getType()
 {
     return Type::resolve($this->type);
 }
開發者ID:andytruong,項目名稱:graphql-php,代碼行數:4,代碼來源:InputObjectField.php

示例8: implementsInterface

 /**
  * @param InterfaceType $iface
  * @return bool
  */
 public function implementsInterface($iface)
 {
     $iface = Type::resolve($iface);
     return !!Utils::find($this->getInterfaces(), function ($implemented) use($iface) {
         return $iface === $implemented;
     });
 }
開發者ID:webonyx,項目名稱:graphql-php,代碼行數:11,代碼來源:ObjectType.php

示例9: getWrappedType

 /**
  * @return Type|callable
  */
 public function getWrappedType()
 {
     $type = Type::resolve($this->ofType);
     Utils::invariant(!$type instanceof NonNull, 'Cannot nest NonNull inside NonNull');
     return $type;
 }
開發者ID:andytruong,項目名稱:graphql-php,代碼行數:9,代碼來源:NonNull.php


注:本文中的GraphQL\Type\Definition\Type::resolve方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。