Skip to content

Commit

Permalink
FEATURE: Flow 4.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed Feb 15, 2017
1 parent 521671e commit 99de9e4
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Classes/AccessibleObject.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Wwwision\GraphQL;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Reflection\ObjectAccess;
use Neos\Flow\Annotations as Flow;
use Neos\Utility\ObjectAccess;

/**
* A proxy that exposes all getters of a given object through an ArrayAccess interface
Expand Down
4 changes: 2 additions & 2 deletions Classes/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use GraphQL\GraphQL;
use GraphQL\Schema;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Mvc\Controller\ActionController;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;
use Wwwision\GraphQL\TypeResolver;
use Wwwision\GraphQL\View\GraphQlView;

Expand Down
8 changes: 4 additions & 4 deletions Classes/Http/HttpOptionsComponent.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace Wwwision\GraphQL\Http;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Component\ComponentChain;
use TYPO3\Flow\Http\Component\ComponentContext;
use TYPO3\Flow\Http\Component\ComponentInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Component\ComponentChain;
use Neos\Flow\Http\Component\ComponentContext;
use Neos\Flow\Http\Component\ComponentInterface;

/**
* A simple HTTP Component that captures OPTIONS requests and responds with a general "Allow: GET, POST" header if a matching graphQL endpoint is configured
Expand Down
2 changes: 1 addition & 1 deletion Classes/IterableAccessibleObject.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Wwwision\GraphQL;

use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;

/**
* A proxy that recursively exposes all getters of objects within a collection (\Iterator or array) through an ArrayAccess interface
Expand Down
2 changes: 1 addition & 1 deletion Classes/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;

/**
* A type resolver (aka factory) for GraphQL type definitions.
Expand Down
10 changes: 5 additions & 5 deletions Classes/View/GraphQlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

use GraphQL\Error\Error;
use GraphQL\Executor\ExecutionResult;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Response as HttpResponse;
use TYPO3\Flow\Log\SystemLoggerInterface;
use TYPO3\Flow\Mvc\View\AbstractView;
use TYPO3\Flow\Exception as FlowException;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Response as HttpResponse;
use Neos\Flow\Log\SystemLoggerInterface;
use Neos\Flow\Mvc\View\AbstractView;
use Neos\Flow\Exception as FlowException;

class GraphQlView extends AbstractView
{
Expand Down
9 changes: 5 additions & 4 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
TYPO3:
Neos:
Flow:
http:
chain:
'process':
process:
chain:
'graphQLOptions':
graphQLOptions:
position: 'before routing'
component: 'Wwwision\GraphQL\Http\HttpOptionsComponent'

Wwwision:
GraphQL:
endpoints: []
# 'some-endpoint':
# 'queryType': 'Some\Fully\Qualified\Namespace'
# 'mutationType': 'Some\Fully\Qualified\Namespace'
# 'mutationType': 'Some\Fully\Qualified\Namespace'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ And, lastly, activate the corresponding routes:
`Settings.yaml`:

```yaml
TYPO3:
Neos:
Flow:
mvc:
routes:
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/AccessibleObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Wwwision\GraphQL\Tests\Unit;

use TYPO3\Flow\Tests\UnitTestCase;
use Neos\Flow\Tests\UnitTestCase;
use Wwwision\GraphQL\AccessibleObject;
use Wwwision\GraphQL\IterableAccessibleObject;
use Wwwision\GraphQL\Tests\Unit\Fixtures\ExampleObject;
Expand Down Expand Up @@ -74,7 +74,7 @@ public function simpleOffsetGetTests($propertyName, $expectedValue)

/**
* @test
* @expectedException \TYPO3\Flow\Reflection\Exception\PropertyNotAccessibleException
* @expectedException \Neos\Utility\Exception\PropertyNotAccessibleException
*/
public function offsetGetThrowsExceptionForUnknownProperties()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/IterableAccessibleObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Wwwision\GraphQL\Tests\Unit;

use TYPO3\Flow\Tests\UnitTestCase;
use Neos\Flow\Tests\UnitTestCase;
use Wwwision\GraphQL\AccessibleObject;
use Wwwision\GraphQL\IterableAccessibleObject;
use Wwwision\GraphQL\Tests\Unit\Fixtures\ExampleObject;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/TypeResolverTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Wwwision\GraphQL\Tests\Unit;

use TYPO3\Flow\Tests\UnitTestCase;
use Neos\Flow\Tests\UnitTestCase;
use Wwwision\GraphQL\Tests\Unit\Fixtures\ExampleType;
use Wwwision\GraphQL\TypeResolver;

Expand Down
31 changes: 29 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "wwwision/graphql",
"license": "MIT",
"require": {
"typo3/flow": "^3.0",
"neos/flow": "^4.0",
"webonyx/graphql-php": "^0.8.0"
},
"autoload": {
Expand All @@ -20,6 +20,33 @@
"extra": {
"neos": {
"package-key": "Wwwision.GraphQL"
}
},
"applied-flow-migrations": [
"TYPO3.FLOW3-201201261636",
"TYPO3.Fluid-201205031303",
"TYPO3.FLOW3-201205292145",
"TYPO3.FLOW3-201206271128",
"TYPO3.FLOW3-201209201112",
"TYPO3.Flow-201209251426",
"TYPO3.Flow-201211151101",
"TYPO3.Flow-201212051340",
"TYPO3.Flow-201310031523",
"TYPO3.Flow-201405111147",
"TYPO3.Fluid-20141113120800",
"TYPO3.Flow-20141113121400",
"TYPO3.Fluid-20141121091700",
"TYPO3.Fluid-20150214130800",
"TYPO3.Flow-20151113161300",
"TYPO3.Flow-20161115140400",
"TYPO3.Flow-20161115140430",
"Neos.Flow-20161124204700",
"Neos.Flow-20161124204701",
"Neos.Flow-20161124224015",
"Neos.Eel-20161124230101",
"Neos.Kickstart-20161124230102",
"Neos.Kickstarter-20161125110814",
"Neos.Flow-20161125124112",
"TYPO3.FluidAdaptor-20161130112935"
]
}
}

0 comments on commit 99de9e4

Please sign in to comment.