getFriends() 정적인 공개 메소드

Allows us to query for a character's friends.
static public getFriends ( $character )
예제 #1
0
 public function build($config)
 {
     parent::build($config);
     $config->getField('friends')->getConfig()->set('resolve', function ($droid) {
         return StarWarsData::getFriends($droid);
     });
     $config->addField('primaryFunction', TypeMap::TYPE_STRING);
 }
예제 #2
0
 public function build($config)
 {
     $config->addField('id', new NonNullType(new IdType()))->addField('name', new NonNullType(new StringType()))->addField('friends', ['type' => new ListType(new CharacterInterface()), 'resolve' => function ($droid) {
         return StarWarsData::getFriends($droid);
     }])->addField('appearsIn', new ListType(new EpisodeEnum()))->addField('homePlanet', TypeMap::TYPE_STRING);
 }