Skip to content

Commit

Permalink
refactor(graphql)!: JsonString renamed to JsonStringType.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Oct 9, 2023
1 parent 45f1cf6 commit 8cf2761
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Probably the most powerful directive to provide sort (`order by` conditions) for
> ```graphql
> scalar JsonString
> @scalar(
> class: "LastDragon_ru\\LaraASP\\GraphQL\\Scalars\\JsonString"
> class: "LastDragon_ru\\LaraASP\\GraphQL\\Scalars\\JsonStringType"
> )
> ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use function json_validate;
use function sprintf;

class JsonString extends StringType implements TypeDefinition {
class JsonStringType extends StringType implements TypeDefinition {
public string $name = 'JsonString';
public ?string $description = 'Represents JSON string.';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
/**
* @internal
*/
#[CoversClass(JsonString::class)]
class JsonStringTest extends TestCase {
#[CoversClass(JsonStringType::class)]
class JsonStringTypeTest extends TestCase {
// <editor-fold desc="Tests">
// =========================================================================
/**
Expand All @@ -27,7 +27,7 @@ public function testSerialize(?Exception $expected, mixed $value): void {
self::expectExceptionObject($expected);
}

$scalar = new JsonString();
$scalar = new JsonStringType();
$actual = $scalar->serialize($value);

if ($value instanceof JsonStringable) {
Expand All @@ -45,7 +45,7 @@ public function testParseValue(?Exception $expected, mixed $value): void {
self::expectExceptionObject($expected);
}

$scalar = new JsonString();
$scalar = new JsonStringType();
$actual = $scalar->parseValue($value);

self::assertIsString($value);
Expand All @@ -60,7 +60,7 @@ public function testParseLiteral(?Exception $expected, Node&ValueNode $value): v
self::expectExceptionObject($expected);
}

$scalar = new JsonString();
$scalar = new JsonStringType();
$actual = $scalar->parseLiteral($value);

self::assertInstanceOf(StringValueNode::class, $value);
Expand Down

0 comments on commit 8cf2761

Please sign in to comment.