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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ CHANGELOG

[Next release](https://github.com/rebing/graphql-laravel/compare/9.11.0...master)

### Fixed
- Fixed type declaration mismatch in scalar type classes generated by `make:graphql:scalar` command by removing premature type hints from the stub [\#1190 / iisyos](https://github.com/rebing/graphql-laravel/pull/1190)

2025-10-07, 9.11.0
------------------

Expand Down
6 changes: 3 additions & 3 deletions src/Console/stubs/scalar.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class DummyClass extends ScalarType implements TypeConvertible
/**
* @var string
*/
public $name = 'DummyClass';
public string $name = 'DummyClass';

/**
* @var string
* @var ?string
*/
public $description = '';
public ?string $description = '';

/**
* Serializes an internal value to include in a response.
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Console/ScalarMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public static function dataForMakeCommand(): array
'inputName' => 'Example',
'expectedFilename' => 'GraphQL/Scalars/Example.php',
'expectedClassDefinition' => 'Example extends ScalarType implements TypeConvertible',
'expectedGraphqlName' => '\$name = \'Example\';',
'expectedGraphqlName' => 'public string \\$name = \'Example\';',
],
'ExampleScalar' => [
'inputName' => 'ExampleScalar',
'expectedFilename' => 'GraphQL/Scalars/ExampleScalar.php',
'expectedClassDefinition' => 'ExampleScalar extends ScalarType implements TypeConvertible',
'expectedGraphqlName' => '\$name = \'ExampleScalar\';',
'expectedGraphqlName' => 'public string \\$name = \'ExampleScalar\';',
],
];
}
Expand Down