Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"symfony/serializer": "^8.0.0",
"symfony/type-info": "^8.0.0",
"symfony/var-dumper": "^8.0.0",
"webonyx/graphql-php": "^15.4.0"
"webonyx/graphql-php": "^15.31.5"
},
"require-dev": {
"ext-xmlwriter": "*",
Expand All @@ -75,7 +75,7 @@
"composer/class-map-generator": "^1.7.0",
"illuminate/config": "^13.0.0",
"laravel/scout": "^10.24.0",
"larastan/larastan": "^3.1.0",
"larastan/larastan": "^3.9.4",
"orchestra/testbench": "^11.0.0",
"phpstan/phpstan": "2.1.46",
"phpstan/phpstan-mockery": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/graphql-printer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The package allows you to print GraphQL Schema and Queries in a highly customize
| | `^8.2` | `7.2.0 ⋯ 3.0.0` |
| | `^8.1` | `6.4.2 ⋯ 3.0.0` |
| | `^8.0` | `4.6.0 ⋯ 3.0.0` |
| `webonyx/graphql-php` | `^15.4.0` | `HEAD ⋯ 4.2.1` |
| `webonyx/graphql-php` | `^15.31.5` | `HEAD` |
| | `^15.4.0` | `10.3.0 ⋯ 4.2.1` |
| | `^15.2.4` | `4.2.0 ⋯ 4.0.0` |
| | `^14.11.9` | `3.0.0` |

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"php": "^8.4|^8.5",
"ext-mbstring": "*",
"composer/semver": "^3.2.0",
"webonyx/graphql-php": "^15.4.0"
"webonyx/graphql-php": "^15.31.5"
},
"require-dev": {
"composer/class-map-generator": "^1.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"^8.4"
],
"webonyx/graphql-php": [
"^15.4.0"
"^15.31.5"
]
},
"10.3.0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use GraphQL\Type\Definition\Directive;
use GraphQL\Type\Definition\InputObjectType;
use LastDragon_ru\GraphQL\Printer\Blocks\Types\InputObjectDefinitionBlock;
use LastDragon_ru\GraphQL\Printer\Feature;
use LastDragon_ru\GraphQL\Printer\Misc\Context;
use LastDragon_ru\GraphQL\Printer\Package\GraphQLAstNode;
use LastDragon_ru\GraphQL\Printer\Package\GraphQLDefinition;
Expand Down Expand Up @@ -41,8 +40,7 @@ protected function getDefinitionDirectives(): NodeList {
$directives = parent::getDefinitionDirectives();

if (
!Feature::OneOfDirective->available()
|| !($definition instanceof InputObjectType)
!($definition instanceof InputObjectType)
|| !isset($definition->isOneOf)
|| !$definition->isOneOf
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\Type;
use LastDragon_ru\GraphQL\Printer\Contracts\Settings;
use LastDragon_ru\GraphQL\Printer\Feature;
use LastDragon_ru\GraphQL\Printer\Misc\Collector;
use LastDragon_ru\GraphQL\Printer\Misc\Context;
use LastDragon_ru\GraphQL\Printer\Package\RequiresFeature;
use LastDragon_ru\GraphQL\Printer\Package\TestCase;
use LastDragon_ru\PhpUnit\GraphQL\PrinterSettings;
use PHPUnit\Framework\Attributes\CoversClass;
Expand Down Expand Up @@ -43,18 +41,6 @@ public function testSerialize(
self::assertSame($expected, $actual);
}

#[DataProvider('dataProviderSerializeOneOf')]
#[RequiresFeature(Feature::OneOfDirective)]
public function testSerializeOneOf(
string $expected,
Settings $settings,
int $level,
int $used,
InputObjectTypeDefinitionNode|InputObjectType $definition,
): void {
$this->testSerialize($expected, $settings, $level, $used, $definition);
}

public function testStatistics(): void {
$context = new Context(new PrinterSettings(), null, null);
$collector = new Collector();
Expand Down Expand Up @@ -102,7 +88,7 @@ public static function dataProviderSerialize(): array {
->setNormalizeFields(false);

return [
'description + directives' => [
'description + directives' => [
<<<'GRAPHQL'
"""
Description
Expand All @@ -127,7 +113,7 @@ public static function dataProviderSerialize(): array {
],
]),
],
'description + directives + fields' => [
'description + directives + fields' => [
<<<'GRAPHQL'
"""
Description
Expand Down Expand Up @@ -187,7 +173,7 @@ public static function dataProviderSerialize(): array {
],
]),
],
'fields' => [
'fields' => [
<<<'GRAPHQL'
input Test {
a: String
Expand All @@ -205,7 +191,7 @@ public static function dataProviderSerialize(): array {
],
]),
],
'indent' => [
'indent' => [
<<<'GRAPHQL'
input Test {
a: String
Expand All @@ -223,7 +209,7 @@ public static function dataProviderSerialize(): array {
],
]),
],
'filter' => [
'filter' => [
'',
$settings
->setTypeDefinitionFilter(static fn () => false),
Expand All @@ -234,7 +220,7 @@ public static function dataProviderSerialize(): array {
'fields' => [],
]),
],
'ast' => [
'ast' => [
<<<'GRAPHQL'
"""
Description
Expand All @@ -256,7 +242,7 @@ public static function dataProviderSerialize(): array {
'"Description" input Test @a @b { a: String }',
),
],
'ast + filter' => [
'ast + filter' => [
'',
$settings
->setTypeDefinitionFilter(static fn () => false),
Expand All @@ -266,17 +252,6 @@ public static function dataProviderSerialize(): array {
'input Test @a { a: String }',
),
],
];
}

/**
* @return array<string,array{string, Settings, int, int, InputObjectTypeDefinitionNode|InputObjectType}>
*/
public static function dataProviderSerializeOneOf(): array {
$settings = (new PrinterSettings())
->setNormalizeFields(false);

return [
'isOneOf = true' => [
<<<'GRAPHQL'
"""
Expand Down Expand Up @@ -360,7 +335,7 @@ public static function dataProviderSerializeOneOf(): array {
],
]),
],
'ast' => [
'@oneOf' => [
<<<'GRAPHQL'
"""
Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use GraphQL\Type\Schema;
use LastDragon_ru\GraphQL\Printer\Blocks\Block;
use LastDragon_ru\GraphQL\Printer\Blocks\Types\DefinitionBlock;
use LastDragon_ru\GraphQL\Printer\Feature;
use LastDragon_ru\GraphQL\Printer\Misc\Collector;
use LastDragon_ru\GraphQL\Printer\Misc\Context;
use LastDragon_ru\GraphQL\Printer\Package\GraphQLAstNode;
Expand Down Expand Up @@ -66,7 +65,7 @@ protected function fields(bool $multiline): ?Block {

private function isUseDefaultRootOperationTypeNames(): bool {
// Description?
if (Feature::SchemaDescription->available() && $this->getDefinition()->description !== null) {
if ($this->getDefinition()->description !== null) {
return false;
}

Expand Down
Loading
Loading