Пример #1
0
 public function testConnectionDefinitions()
 {
     $nodeType = new ObjectType(['name' => 'test']);
     $config = ['nodeType' => $nodeType];
     $this->assertEquals(Connection::connectionDefinitions($config), Relay::connectionDefinitions($config));
 }
Пример #2
0
 /**
  * Returns a GraphQLObjectType for a connection and its edge with the given name,
  * and whose nodes are of the specified type.
  *
  * @param array $config
  * @return array
  */
 public static function connectionDefinitions(array $config)
 {
     return Connection::connectionDefinitions($config);
 }
Пример #3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testConnectionDefinitionThrowsWithoutNodeType()
 {
     Connection::connectionDefinitions([]);
 }