当前位置: 首页>>代码示例>>PHP>>正文


PHP Type::nonNull方法代码示例

本文整理汇总了PHP中Type::nonNull方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::nonNull方法的具体用法?PHP Type::nonNull怎么用?PHP Type::nonNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Type的用法示例。


在下文中一共展示了Type::nonNull方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInternalDirectives

 /**
  * @return array
  */
 public static function getInternalDirectives()
 {
     if (!self::$internalDirectives) {
         self::$internalDirectives = ['include' => new self(['name' => 'include', 'description' => 'Directs the executor to include this field or fragment only when the `if` argument is true.', 'locations' => [self::LOCATION_FIELD, self::LOCATION_FRAGMENT_SPREAD, self::LOCATION_INLINE_FRAGMENT], 'args' => [new FieldArgument(['name' => 'if', 'type' => Type::nonNull(Type::boolean()), 'description' => 'Included when true.'])]]), 'skip' => new self(['name' => 'skip', 'description' => 'Directs the executor to skip this field or fragment when the `if` argument is true.', 'locations' => [self::LOCATION_FIELD, self::LOCATION_FRAGMENT_SPREAD, self::LOCATION_INLINE_FRAGMENT], 'args' => [new FieldArgument(['name' => 'if', 'type' => Type::nonNull(Type::boolean()), 'description' => 'Skipped when true'])]]), 'deprecated' => new self(['name' => 'deprecated', 'description' => 'Marks an element of a GraphQL schema as no longer supported.', 'locations' => [self::LOCATION_FIELD_DEFINITION, self::LOCATION_ENUM_VALUE], 'args' => [new FieldArgument(['name' => 'reason', 'type' => Type::string(), 'description' => 'Explains why this element was deprecated, usually also including a ' . 'suggestion for how to access supported similar data. Formatted ' . 'in [Markdown](https://daringfireball.net/projects/markdown/).', 'defaultValue' => self::DEFAULT_DEPRECATION_REASON])]])];
     }
     return self::$internalDirectives;
 }
开发者ID:aeshion,项目名称:ZeroPHP,代码行数:10,代码来源:Directive.php

示例2: getInternalDirectives

 public static function getInternalDirectives()
 {
     if (!self::$internalDirectives) {
         self::$internalDirectives = ['include' => new self(['name' => 'include', 'description' => 'Directs the executor to include this field or fragment only when the `if` argument is true.', 'args' => [new FieldArgument(['name' => 'if', 'type' => Type::nonNull(Type::boolean()), 'description' => 'Included when true.'])], 'onOperation' => false, 'onFragment' => true, 'onField' => true]), 'skip' => new self(['name' => 'skip', 'description' => 'Directs the executor to skip this field or fragment when the `if` argument is true.', 'args' => [new FieldArgument(['name' => 'if', 'type' => Type::nonNull(Type::boolean()), 'description' => 'Skipped when true'])], 'onOperation' => false, 'onFragment' => true, 'onField' => true])];
     }
     return self::$internalDirectives;
 }
开发者ID:andytruong,项目名称:graphql-php,代码行数:7,代码来源:Directive.php

示例3: getInternalDirectives

 public static function getInternalDirectives()
 {
     if (!self::$internalDirectives) {
         self::$internalDirectives = ['if' => new self(['name' => 'if', 'description' => 'Directs the executor to omit this field if the argument provided is false.', 'type' => Type::nonNull(Type::boolean()), 'onOperation' => false, 'onFragment' => false, 'onField' => true]), 'unless' => new self(['name' => 'unless', 'description' => 'Directs the executor to omit this field if the argument provided is true.', 'type' => Type::nonNull(Type::boolean()), 'onOperation' => false, 'onFragment' => false, 'onField' => true])];
     }
     return self::$internalDirectives;
 }
开发者ID:rtuin,项目名称:graphql-php,代码行数:7,代码来源:Directive.php

示例4: inputFields

 /**
  * Input fields for mutation.
  *
  * @return array
  */
 protected function inputFields()
 {
     return ['id' => ['name' => 'id', 'type' => Type::nonNull(Type::string())], 'name' => ['name' => 'name', 'type' => Type::nonNull(Type::string())]];
 }
开发者ID:nuwave,项目名称:laravel-graphql-relay,代码行数:9,代码来源:UpdateHeroNameQuery.php

示例5: args

 /**
  * Available query arguments.
  *
  * @return array
  */
 public function args()
 {
     return ['id' => ['type' => Type::nonNull(Type::string())]];
 }
开发者ID:nuwave,项目名称:lighthouse,代码行数:9,代码来源:UserQuery.php


注:本文中的Type::nonNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。