Inheritance: extends Youshido\GraphQL\Field\AbstractField
Example #1
0
 public function testArgumentsTrait()
 {
     $testField = new TestField();
     $this->assertFalse($testField->hasArguments());
     $testField->addArgument(new InputField(['name' => 'id', 'type' => new IntType()]));
     $this->assertEquals(['id' => new InputField(['name' => 'id', 'type' => new IntType()])], $testField->getArguments());
     $testField->addArguments([new InputField(['name' => 'name', 'type' => new StringType()])]);
     $this->assertEquals(['id' => new InputField(['name' => 'id', 'type' => new IntType()]), 'name' => new InputField(['name' => 'name', 'type' => new StringType()])], $testField->getArguments());
     $testField->removeArgument('name');
     $this->assertFalse($testField->hasArgument('name'));
 }