Created
September 21, 2017 12:47
-
-
Save kevinvdburgt/cc00d59ab12ee3f2233e6f87d9d351d5 to your computer and use it in GitHub Desktop.
PHP GraphQL
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\Query\General; | |
use Folklore\GraphQL\Support\Query; | |
use GraphQL\Type\Definition\ResolveInfo; | |
use GraphQL\Type\Definition\Type; | |
use GraphQL; | |
class Test extends Query | |
{ | |
protected $attributes = [ | |
'name' => 'Test', | |
'description' => 'A query' | |
]; | |
public function type() | |
{ | |
return Type::listOf(GraphQL::type('Test')); | |
} | |
public function args() | |
{ | |
return [ | |
]; | |
} | |
public function resolve($root, $args, $context, ResolveInfo $info) | |
{ | |
return []; | |
} | |
} |
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\General; | |
use GraphQL\Type\Definition\Type; | |
use Folklore\GraphQL\Support\Type as BaseType; | |
use GraphQL; | |
class Test extends BaseType | |
{ | |
protected $attributes = [ | |
'name' => 'Test', | |
'description' => 'A type' | |
]; | |
public function fields() | |
{ | |
return [ | |
'name' => [ | |
'type' => Type::string(), | |
], | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment