diff --git a/README.md b/README.md index d4f8faa32..c0a7b27c0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ It uses the [graphql-php](https://github.com/webonyx/graphql-php) library. Require the [composer](http://getcomposer.org) package in your `composer.json` ``` -composer require silverstripe/graphql +composer require chillu/silverstripe-graphql ``` ## Usage @@ -28,7 +28,7 @@ You need to define *Types* and *Queries* to expose your data via this endpoint. ```yml -SilverStripe\GraphQL: +Chillu\GraphQL: schema: types: member: 'MyProject\GraphQL\MemberTypeCreator' @@ -39,7 +39,7 @@ SilverStripe\GraphQL: namespace MyProject\GraphQL; use GraphQL\Type\Definition\Type; -use SilverStripe\GraphQL\TypeCreator; +use Chillu\GraphQL\TypeCreator; class MemberTypeCreator extends TypeCreator { @@ -61,7 +61,7 @@ class MemberTypeCreator extends TypeCreator { ### Define Queries ```yml -SilverStripe\GraphQL: +Chillu\GraphQL: schema: queries: members: 'MyProject\GraphQL\MemberQueryCreator' @@ -72,7 +72,7 @@ SilverStripe\GraphQL: namespace MyProject\GraphQL; use GraphQL\Type\Definition\Type; -use SilverStripe\GraphQL\QueryCreator; +use Chillu\GraphQL\QueryCreator; use MyProject\MyDataObject; use SilverStripe\Security\Member; diff --git a/_config/routes.yml b/_config/routes.yml index 698db238e..88e5ac790 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -3,4 +3,4 @@ Name: graphqlroutes --- SilverStripe\Control\Director: rules: - 'graphql': 'SilverStripe\GraphQL\Controller' + 'graphql': 'Chillu\GraphQL\Controller' diff --git a/composer.json b/composer.json index 59e15b443..0dd2c7c5b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "silverstripe/graphql", + "name": "chillu/silverstripe-graphql", "description": "GraphQL server for SilverStripe models and other data", "type": "silverstripe-module", "require": { @@ -17,7 +17,7 @@ }, "autoload": { "psr-4": { - "SilverStripe\\GraphQL\\": "src/" + "Chillu\\GraphQL\\": "src/" } }, "config": { diff --git a/src/Controller.php b/src/Controller.php index 08e603f10..571563892 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -1,6 +1,6 @@ get('SilverStripe\GraphQL', 'schema'); + $config = Config::inst()->get('Chillu\GraphQL', 'schema'); $manager = Injector::inst()->create(Manager::class, $config); return $manager; diff --git a/src/FieldCreator.php b/src/FieldCreator.php index 9d9dc6c09..e1e2f4d2c 100644 --- a/src/FieldCreator.php +++ b/src/FieldCreator.php @@ -1,6 +1,6 @@ update('SilverStripe\GraphQL', 'schema', [ + Config::inst()->update('Chillu\GraphQL', 'schema', [ 'types' => [ 'mytype' => TypeCreatorFake::class, ], diff --git a/tests/Fake/QueryCreatorFake.php b/tests/Fake/QueryCreatorFake.php index 5973fce04..beeff6707 100644 --- a/tests/Fake/QueryCreatorFake.php +++ b/tests/Fake/QueryCreatorFake.php @@ -1,9 +1,9 @@ getMockBuilder('SilverStripe\GraphQL\FieldCreator') + $mock = $this->getMockBuilder('Chillu\GraphQL\FieldCreator') ->setMethods(['resolve']) ->getMock(); $mock->method('resolve')->willReturn(function () { diff --git a/tests/ManagerTest.php b/tests/ManagerTest.php index d3acbdd4b..ee5c1ec58 100644 --- a/tests/ManagerTest.php +++ b/tests/ManagerTest.php @@ -1,10 +1,10 @@