getReturnType() public méthode

public getReturnType ( ) : AbstractType
Résultat Youshido\GraphQL\Type\AbstractType
Exemple #1
0
 public function testMethods()
 {
     $fieldAst = new FieldAST('name', null, [], new Location(1, 1));
     $field = new Field(['name' => 'id', 'type' => new IntType()]);
     $returnType = new IntType();
     $executionContext = new ExecutionContext(new TestSchema());
     $info = new ResolveInfo($field, [$fieldAst], $executionContext);
     $this->assertEquals($field, $info->getField());
     $this->assertEquals([$fieldAst], $info->getFieldASTList());
     $this->assertEquals($returnType, $info->getReturnType());
     $this->assertEquals($executionContext, $info->getExecutionContext());
 }
Exemple #2
0
 /**
  * @param null        $value
  * @param array       $args
  * @param ResolveInfo $info
  * @return mixed
  */
 public function resolve($value, array $args, ResolveInfo $info)
 {
     return $info->getReturnType()->getOne($args['id']);
 }