当前位置: 首页>>代码示例>>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;未经允许,请勿转载。