Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Symfony 7 and GraphQLite 8 #1

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
730a640
chore: update deps
fogrye Mar 28, 2024
c6fdb1a
fix: replace ClassNameMapper with Finder
fogrye Mar 28, 2024
830af6a
fix: namespace should not end with \
fogrye Mar 28, 2024
574677e
rm fork
fogrye Mar 28, 2024
523f267
Update composer.json
fogrye Mar 29, 2024
2965602
fix: typing
fogrye Mar 29, 2024
5a05d3a
fix: assertion
fogrye Mar 29, 2024
d9e86ce
chore: correct validator version
fogrye Apr 13, 2024
f00dd6c
chore: bump php version to satisfy symfony packages
fogrye May 4, 2024
f6aac0e
fix(ci): bump ci php version
fogrye May 5, 2024
10e191f
:package: Make it compatible with PHP 8.1+ again - bundle is compatib…
andrew-demb Nov 16, 2024
8d0a0da
:package: Don't use Doctrine annotation for Symfony Validator - in v7…
andrew-demb Nov 16, 2024
c21cfdf
:package: Rework bundle structure according to the latest Symfony rec…
andrew-demb Nov 16, 2024
3d4c71a
:package: Fix compatibility with graphqlite v7
andrew-demb Nov 16, 2024
77f48c1
:package: Use `dev-master` for graphqlite because of improved perform…
andrew-demb Nov 16, 2024
75ea338
:package: Don't use deprecated method from `graphqlite`
andrew-demb Nov 16, 2024
818ff34
:package: Migrate to attributes - since support for Doctrine annotati…
andrew-demb Nov 16, 2024
7f720ae
:sparkles: Use service locator for `AggregateControllerQueryProviderF…
andrew-demb Nov 16, 2024
6b90bd4
:package: Improve readability
andrew-demb Nov 16, 2024
30dce85
:fire: Drop useless assert
andrew-demb Nov 16, 2024
06f4664
:rotating_light: Apply workaround for cache-related issue in tests
andrew-demb Nov 17, 2024
189589d
:package: Migrate to attributes - since support for Doctrine annotati…
andrew-demb Nov 17, 2024
a966ef1
:bug: Fix support for autowiring attribute in compiler pass - it is n…
andrew-demb Nov 17, 2024
d608925
:package: Fix phpstan command after reworking directory structure
andrew-demb Nov 17, 2024
c84f922
:fire: Drop bad class from test suite - this feature (ignoring psr-4 …
andrew-demb Nov 17, 2024
482fbe0
:poop: Use own `graphqlite` fork with applied fixes to show that CI i…
andrew-demb Nov 18, 2024
8c48367
:package: Switch back to the `dev-master` for origin `graphqlite` - r…
andrew-demb Nov 27, 2024
67d2b07
:package: Use stable graphqlite (v8). Use dev version of graphqlite v…
andrew-demb Dec 18, 2024
d158328
:package: Avoid deprecated
andrew-demb Dec 18, 2024
90ef14c
:fire: Doctrine annotations is not supported since GraphQLite 7 - dro…
andrew-demb Dec 18, 2024
25b690c
:package: Declare properties before methods. Add typing. Drop useless…
andrew-demb Dec 18, 2024
de1eb05
Merge branch 'master' into symfony-7
andrew-demb Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
install-args: ['']
php-version: ['8.1']
php-version: ['8.2']
fail-fast: false
steps:
# Cancel previous runs of the same branch
Expand Down
8 changes: 0 additions & 8 deletions Tests/Fixtures/Entities/BadClass.php

This file was deleted.

23 changes: 16 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
"require" : {
"php" : ">=8.1",
"ext-json": "*",
"thecodingmachine/graphqlite" : "^6.0",
"thecodingmachine/graphqlite-symfony-validator-bridge" : "^6.0",
"thecodingmachine/graphqlite" : "^8",
"thecodingmachine/graphqlite-symfony-validator-bridge": "dev-graphqlite-8 as v7.1.0",
"symfony/config": "^6.4 || ^7",
"symfony/console": "^6.4 || ^7",
"symfony/framework-bundle": "^6.4 || ^7",
"symfony/validator": "^6.4 || ^7",
"symfony/translation": "^6.4 || ^7",
"doctrine/annotations": "^1.13 || ^2.0.1",
"symfony/psr-http-message-bridge": "^2.0 || ^7.0",
"nyholm/psr7": "^1.1",
"laminas/laminas-diactoros": "^2.2.2 || ^3",
Expand All @@ -42,21 +41,31 @@
"composer/semver": "^3.4"
},
"conflict": {
"mouf/classname-mapper": "<1.0.2",
"symfony/event-dispatcher": "<4.3",
"symfony/security-core": "<4.3",
"symfony/routing": "<4.3",
"phpdocumentor/type-resolver": "<1.4"
},
"scripts": {
"phpstan": "phpstan analyse GraphQLiteBundle.php DependencyInjection/ Controller/ Resources/ Security/ -c phpstan.neon --level=7 --no-progress"
"phpstan": "phpstan analyse -c phpstan.neon --level=7 --no-progress"
},
"suggest": {
"symfony/security-bundle": "To use @Logged or @Right annotations"
"symfony/security-bundle": "To use #[Logged] or #[Right] attributes"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/andrew-demb/graphqlite-symfony-validator-bridge.git"
}
],
"autoload" : {
"psr-4" : {
"TheCodingMachine\\GraphQLite\\Bundle\\" : ""
"TheCodingMachine\\GraphQLite\\Bundle\\" : "src"
}
},
"autoload-dev" : {
"psr-4" : {
"TheCodingMachine\\GraphQLite\\Bundle\\Tests\\" : "tests"
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- vendor
- cache
- .phpstan-cache
- Tests
- tests
level: max
polluteScopeWithLoopInitialAssignments: false
polluteScopeWithAlwaysIterableForeach: false
Expand Down
13 changes: 4 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,17 @@
</php>

<testsuites>
<testsuite name="Graphql controllers bundle Test Suite">
<directory>./Tests/</directory>
<testsuite name="GraphQLite Bundle Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>


<filter>
<whitelist>
<directory>./</directory>
<directory>./src/</directory>
<exclude>
<directory>cache</directory>
<directory>build</directory>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
<directory>./var</directory>
<directory>./src/Resources</directory>
</exclude>
</whitelist>
</filter>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class InvalidUserPasswordException extends GraphQLException
{
public static function create(Exception $previous = null): self
{
return new self('The provided user / password is incorrect.', 401, $previous, 'Security');
return new self('The provided user / password is incorrect.', 401, $previous, ['category' => 'Security']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ public function __construct(UserProviderInterface $userProvider, UserPasswordHas
$this->eventDispatcher = $eventDispatcher;
}

/**
* @Mutation()
*
* @phpstan-return TUser
*/
#[Mutation]
public function login(string $userName, string $password, Request $request): UserInterface
{
try {
Expand Down Expand Up @@ -95,9 +91,7 @@ public function login(string $userName, string $password, Request $request): Use
return $user;
}

/**
* @Mutation()
*/
#[Mutation]
public function logout(Request $request): bool
{
$this->tokenStorage->setToken(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ public function __construct(TokenStorageInterface $tokenStorage)
$this->tokenStorage = $tokenStorage;
}

/**
* @Query()
*/
#[Query]
public function me(): ?UserInterface
{
$token = $this->tokenStorage->getToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
namespace TheCodingMachine\GraphQLite\Bundle\Controller;


use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use TheCodingMachine\GraphQLite\Http\HttpCodeDecider;
use TheCodingMachine\GraphQLite\Http\HttpCodeDeciderInterface;
use function array_map;
use GraphQL\Executor\ExecutionResult;
use GraphQL\Server\ServerConfig;
use GraphQL\Server\StandardServer;
use GraphQL\Upload\UploadMiddleware;
use function class_exists;
use function json_decode;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
use Psr\Http\Message\ServerRequestInterface;
use RuntimeException;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use TheCodingMachine\GraphQLite\Bundle\Context\SymfonyGraphQLContext;
use TheCodingMachine\GraphQLite\Http\HttpCodeDecider;
use TheCodingMachine\GraphQLite\Http\HttpCodeDeciderInterface;
use function array_map;
use function class_exists;
use function json_decode;

/**
* Listens to every single request and forward Graphql requests to Graphql Webonix standardServer.
Expand Down
Loading
Loading