Created
August 5, 2018 09:30
-
-
Save ragasubekti/9f6ebec248e6a1652df90b4cf4dc3632 to your computer and use it in GitHub Desktop.
GQL Type OPD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\GraphQL\Type; | |
use GraphQL\Type\Definition\Type; | |
use Rebing\GraphQL\Support\Type as GraphQLType; | |
class OpdType extends GraphQLType | |
{ | |
protected $attributes = [ | |
'name' => 'OpdType', | |
]; | |
public function fields() | |
{ | |
return [ | |
[ | |
'type' => Type::nonNull(Type::int()), | |
'name' => 'kode', | |
'alias' => 'kdlokasi', | |
'resolve' => function ($q) {return $q->kdlokasi;}, | |
], [ | |
'type' => Type::string(), | |
'name' => 'nama', | |
'alias' => 'nmlokasi', | |
'resolve' => function ($q) {return $q->nmlokasi;}, | |
], | |
[ | |
'type' => Type::int(), | |
'name' => 'kodeParent', | |
'alias' => 'kdparent', | |
'resolve' => function ($q) {return $q->kdparent;}, | |
], | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment