diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b306dbb..e2424b1eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ You can find and compare releases at the [GitHub release page](https://github.co ## Unreleased +### Fixed + +- Fix `Date` scalar trying to parse `Illuminate\Support\Carbon` as `string` https://github.com/nuwave/lighthouse/pull/2470 + ## v6.34.0 ### Added diff --git a/src/Schema/AST/ASTBuilder.php b/src/Schema/AST/ASTBuilder.php index 848068616..97531f28e 100644 --- a/src/Schema/AST/ASTBuilder.php +++ b/src/Schema/AST/ASTBuilder.php @@ -220,8 +220,7 @@ protected function missingBaseDefinition(string $typeName, ObjectTypeExtensionNo protected function assertExtensionMatchesDefinition( ObjectTypeExtensionNode|InputObjectTypeExtensionNode|InterfaceTypeExtensionNode|ScalarTypeExtensionNode|EnumTypeExtensionNode|UnionTypeExtensionNode $extension, ObjectTypeDefinitionNode|InputObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ScalarTypeDefinitionNode|EnumTypeDefinitionNode|UnionTypeDefinitionNode $definition, - ): void - { + ): void { if (static::EXTENSION_TO_DEFINITION_CLASS[$extension::class] !== $definition::class) { throw new DefinitionException("The type extension {$extension->name->value} of kind {$extension->kind} can not extend a definition of kind {$definition->kind}."); } diff --git a/src/Schema/Types/Scalars/DateScalar.php b/src/Schema/Types/Scalars/DateScalar.php index d63666b03..2b07a07c0 100644 --- a/src/Schema/Types/Scalars/DateScalar.php +++ b/src/Schema/Types/Scalars/DateScalar.php @@ -56,26 +56,28 @@ public function parseLiteral(Node $valueNode, ?array $variables = null): Illumin protected function tryParsingDate(mixed $value, string $exceptionClass): IlluminateCarbon { try { - if ( - is_object($value) + if (is_object($value)) { + if ($value::class === IlluminateCarbon::class) { + return $value; + } + // We want to know if we have exactly a Carbon\Carbon, not a subclass thereof - && ( - $value::class === CarbonCarbon::class + if ($value::class === CarbonCarbon::class || $value::class === CarbonImmutable::class - ) - ) { - $carbon = IlluminateCarbon::create( - $value->year, - $value->month, - $value->day, - $value->hour, - $value->minute, - $value->second, - $value->timezone, - ); - assert($carbon instanceof IlluminateCarbon, 'Given we had a valid Carbon instance before, this can not fail.'); + ) { + $carbon = IlluminateCarbon::create( + $value->year, + $value->month, + $value->day, + $value->hour, + $value->minute, + $value->second, + $value->timezone, + ); + assert($carbon instanceof IlluminateCarbon, 'Given we had a valid Carbon instance before, this can not fail.'); - return $carbon; + return $carbon; + } } return $this->parse($value); diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php index 245301a96..d3cdb9263 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php @@ -23,8 +23,8 @@ class ContextualizedQueryLatencyStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var QueryLatencyStats $query_latency_stats - * @var StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $query_latency_stats + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context * } */ public function __construct($data = null) @@ -36,7 +36,7 @@ public function __construct($data = null) /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 1 [json_name = "queryLatencyStats"];. * - * @return QueryLatencyStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats|null */ public function getQueryLatencyStats() { @@ -56,7 +56,7 @@ public function clearQueryLatencyStats() /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 1 [json_name = "queryLatencyStats"];. * - * @param QueryLatencyStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $var * * @return $this */ @@ -71,7 +71,7 @@ public function setQueryLatencyStats($var) /** * Generated from protobuf field .StatsContext context = 2 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -91,7 +91,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 2 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php index a29e2c8b9..260fdbbcd 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -31,8 +32,8 @@ class ContextualizedStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var StatsContext $context - * @var QueryLatencyStats $query_latency_stats + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $query_latency_stats * @var array|\Google\Protobuf\Internal\MapField $per_type_stat * Key is type name. This structure provides data for the count and latency of individual * field executions and thus only reflects operations for which field-level tracing occurred. @@ -47,7 +48,7 @@ public function __construct($data = null) /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -67,7 +68,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ @@ -82,7 +83,7 @@ public function setContext($var) /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 2 [json_name = "queryLatencyStats"];. * - * @return QueryLatencyStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats|null */ public function getQueryLatencyStats() { @@ -102,7 +103,7 @@ public function clearQueryLatencyStats() /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 2 [json_name = "queryLatencyStats"];. * - * @param QueryLatencyStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $var * * @return $this */ @@ -139,7 +140,7 @@ public function getPerTypeStat() */ public function setPerTypeStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TypeStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TypeStat::class); $this->per_type_stat = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php index 4c6df3578..68e230602 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -23,7 +24,7 @@ class ContextualizedTypeStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context * @var array|\Google\Protobuf\Internal\MapField $per_type_stat * } */ @@ -36,7 +37,7 @@ public function __construct($data = null) /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -56,7 +57,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ @@ -87,7 +88,7 @@ public function getPerTypeStat() */ public function setPerTypeStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TypeStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TypeStat::class); $this->per_type_stat = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/FieldStat.php b/src/Tracing/FederatedTracing/Proto/FieldStat.php index 42c091bc7..eeeaa606d 100644 --- a/src/Tracing/FederatedTracing/Proto/FieldStat.php +++ b/src/Tracing/FederatedTracing/Proto/FieldStat.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -327,7 +328,7 @@ public function getLatencyCount() */ public function setLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->latency_count = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/PathErrorStats.php b/src/Tracing/FederatedTracing/Proto/PathErrorStats.php index 59d6b9598..71de5d981 100644 --- a/src/Tracing/FederatedTracing/Proto/PathErrorStats.php +++ b/src/Tracing/FederatedTracing/Proto/PathErrorStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -56,7 +57,7 @@ public function getChildren() */ public function setChildren($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, PathErrorStats::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, PathErrorStats::class); $this->children = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php b/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php index a2f522370..7c1835a58 100644 --- a/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php +++ b/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -107,7 +108,7 @@ class QueryLatencyStats extends \Google\Protobuf\Internal\Message * @var array|array|\Google\Protobuf\Internal\RepeatedField $cache_latency_count * This array includes the latency buckets for all operations included in cache_hits * See comment on latency_count for details - * @var PathErrorStats $root_error_stats + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats $root_error_stats * Paths and counts for each error. The total number of requests with errors within this object should be the same as * requests_with_errors_count below. * @var int|string $requests_with_errors_count @@ -159,7 +160,7 @@ public function getLatencyCount() */ public function setLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->latency_count = $arr; return $this; @@ -298,7 +299,7 @@ public function getCacheLatencyCount() */ public function setCacheLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->cache_latency_count = $arr; return $this; @@ -310,7 +311,7 @@ public function setCacheLatencyCount($var) * * Generated from protobuf field .PathErrorStats root_error_stats = 7 [json_name = "rootErrorStats"]; * - * @return PathErrorStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats|null */ public function getRootErrorStats() { @@ -333,7 +334,7 @@ public function clearRootErrorStats() * * Generated from protobuf field .PathErrorStats root_error_stats = 7 [json_name = "rootErrorStats"]; * - * @param PathErrorStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats $var * * @return $this */ @@ -393,7 +394,7 @@ public function getPublicCacheTtlCount() */ public function setPublicCacheTtlCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->public_cache_ttl_count = $arr; return $this; @@ -418,7 +419,7 @@ public function getPrivateCacheTtlCount() */ public function setPrivateCacheTtlCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->private_cache_ttl_count = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php b/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php index 21cfe1f6f..5c52f4d11 100644 --- a/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php +++ b/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -66,7 +67,7 @@ public function getFieldNames() */ public function setFieldNames($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkRepeatedField($var, GPBType::STRING); $this->field_names = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Report.php b/src/Tracing/FederatedTracing/Proto/Report.php index da81b96e0..8c79ee8cd 100644 --- a/src/Tracing/FederatedTracing/Proto/Report.php +++ b/src/Tracing/FederatedTracing/Proto/Report.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -76,7 +77,7 @@ class Report extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var ReportHeader $header + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader $header * @var array|\Google\Protobuf\Internal\MapField $traces_per_query * If QueryMetadata isn't provided, this key should be a statsReportKey (# operationName\nsignature). If the operation * name, signature, and persisted query IDs are provided in the QueryMetadata, and this operation was requested via a @@ -110,7 +111,7 @@ public function __construct($data = null) /** * Generated from protobuf field .ReportHeader header = 1 [json_name = "header"];. * - * @return ReportHeader|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader|null */ public function getHeader() { @@ -130,7 +131,7 @@ public function clearHeader() /** * Generated from protobuf field .ReportHeader header = 1 [json_name = "header"];. * - * @param ReportHeader $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader $var * * @return $this */ @@ -169,7 +170,7 @@ public function getTracesPerQuery() */ public function setTracesPerQuery($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TracesAndStats::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TracesAndStats::class); $this->traces_per_query = $arr; return $this; @@ -278,7 +279,7 @@ public function getOperationCountByType() */ public function setOperationCountByType($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Report\OperationCountByType::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Report\OperationCountByType::class); $this->operation_count_by_type = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace.php b/src/Tracing/FederatedTracing/Proto/Trace.php index 79f98bc6f..6748c97c2 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace.php +++ b/src/Tracing/FederatedTracing/Proto/Trace.php @@ -176,7 +176,7 @@ class Trace extends \Google\Protobuf\Internal\Message * @var int|string $duration_ns * High precision duration of the trace; may not equal end_time-start_time * (eg, if your machine's clock changed during the trace) - * @var Trace\Node $root + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node $root * A tree containing information about all resolvers run directly by this * service, including errors * @var bool $is_incomplete @@ -203,14 +203,14 @@ class Trace extends \Google\Protobuf\Internal\Message * can include reference to the operation being sent for users to dig into the set of operations * that are failing validation * @var string $unexecutedOperationName - * @var Trace\Details $details + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details $details * @var string $client_name * @var string $client_version * @var string $operation_type * @var string $operation_subtype - * @var Trace\HTTP $http - * @var Trace\CachePolicy $cache_policy - * @var Trace\QueryPlanNode $query_plan + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP $http + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $cache_policy + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode $query_plan * If this Trace was created by a Router/Gateway, this is the query plan, including * sub-Traces for subgraphs. Note that the 'root' tree on the * top-level Trace won't contain any resolvers (though it could contain errors @@ -358,7 +358,7 @@ public function setDurationNs($var) * * Generated from protobuf field .Trace.Node root = 14 [json_name = "root"]; * - * @return Trace\Node|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node|null */ public function getRoot() { @@ -381,7 +381,7 @@ public function clearRoot() * * Generated from protobuf field .Trace.Node root = 14 [json_name = "root"]; * - * @param Trace\Node $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node $var * * @return $this */ @@ -542,7 +542,7 @@ public function setUnexecutedOperationName($var) /** * Generated from protobuf field .Trace.Details details = 6 [json_name = "details"];. * - * @return Trace\Details|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details|null */ public function getDetails() { @@ -562,7 +562,7 @@ public function clearDetails() /** * Generated from protobuf field .Trace.Details details = 6 [json_name = "details"];. * - * @param Trace\Details $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details $var * * @return $this */ @@ -677,7 +677,7 @@ public function setOperationSubtype($var) /** * Generated from protobuf field .Trace.HTTP http = 10 [json_name = "http"];. * - * @return Trace\HTTP|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP|null */ public function getHttp() { @@ -697,7 +697,7 @@ public function clearHttp() /** * Generated from protobuf field .Trace.HTTP http = 10 [json_name = "http"];. * - * @param Trace\HTTP $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP $var * * @return $this */ @@ -712,7 +712,7 @@ public function setHttp($var) /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 18 [json_name = "cachePolicy"];. * - * @return Trace\CachePolicy|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy|null */ public function getCachePolicy() { @@ -732,7 +732,7 @@ public function clearCachePolicy() /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 18 [json_name = "cachePolicy"];. * - * @param Trace\CachePolicy $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $var * * @return $this */ @@ -752,7 +752,7 @@ public function setCachePolicy($var) * * Generated from protobuf field .Trace.QueryPlanNode query_plan = 26 [json_name = "queryPlan"]; * - * @return Trace\QueryPlanNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode|null */ public function getQueryPlan() { @@ -777,7 +777,7 @@ public function clearQueryPlan() * * Generated from protobuf field .Trace.QueryPlanNode query_plan = 26 [json_name = "queryPlan"]; * - * @param Trace\QueryPlanNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Details.php b/src/Tracing/FederatedTracing/Proto/Trace/Details.php index 17f52859e..29b7dfd76 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Details.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Details.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -82,7 +83,7 @@ public function getVariablesJson() */ public function setVariablesJson($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::STRING); $this->variables_json = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Error.php b/src/Tracing/FederatedTracing/Proto/Trace/Error.php index 99506dd0f..d837dca58 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Error.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Error.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -94,7 +95,7 @@ public function getLocation() */ public function setLocation($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Location::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Location::class); $this->location = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php b/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php index 20e070bc5..81aa24195 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -94,7 +95,7 @@ public function getRequestHeaders() */ public function setRequestHeaders($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, HTTP\Values::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, HTTP\Values::class); $this->request_headers = $arr; return $this; @@ -119,7 +120,7 @@ public function getResponseHeaders() */ public function setResponseHeaders($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, HTTP\Values::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, HTTP\Values::class); $this->response_headers = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php b/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php index bfef7f64f..13a41ff44 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -48,7 +49,7 @@ public function getValue() */ public function setValue($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkRepeatedField($var, GPBType::STRING); $this->value = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Node.php b/src/Tracing/FederatedTracing/Proto/Trace/Node.php index 1b065ecbf..c8e93bc5b 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Node.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Node.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -72,7 +73,7 @@ class Node extends \Google\Protobuf\Internal\Message * The field's return type; e.g. "String!" for User.email:String! * @var string $parent_type * The field's parent type; e.g. "User" for User.email:String! - * @var CachePolicy $cache_policy + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $cache_policy * @var int|string $start_time * relative to the trace's start_time, in ns * @var int|string $end_time @@ -233,7 +234,7 @@ public function setParentType($var) /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 5 [json_name = "cachePolicy"];. * - * @return CachePolicy|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy|null */ public function getCachePolicy() { @@ -253,7 +254,7 @@ public function clearCachePolicy() /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 5 [json_name = "cachePolicy"];. * - * @param CachePolicy $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $var * * @return $this */ @@ -342,7 +343,7 @@ public function getError() */ public function setError($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Error::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Error::class); $this->error = $arr; return $this; @@ -367,7 +368,7 @@ public function getChild() */ public function setChild($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Node::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Node::class); $this->child = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php index 43a5407c4..6fa1ad23d 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php @@ -24,12 +24,12 @@ class QueryPlanNode extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var QueryPlanNode\SequenceNode $sequence - * @var QueryPlanNode\ParallelNode $parallel - * @var QueryPlanNode\FetchNode $fetch - * @var QueryPlanNode\FlattenNode $flatten - * @var QueryPlanNode\DeferNode $defer - * @var QueryPlanNode\ConditionNode $condition + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode $sequence + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode $parallel + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode $fetch + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode $flatten + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode $defer + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode $condition * } */ public function __construct($data = null) @@ -41,7 +41,7 @@ public function __construct($data = null) /** * Generated from protobuf field .Trace.QueryPlanNode.SequenceNode sequence = 1 [json_name = "sequence"];. * - * @return QueryPlanNode\SequenceNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode|null */ public function getSequence() { @@ -56,7 +56,7 @@ public function hasSequence() /** * Generated from protobuf field .Trace.QueryPlanNode.SequenceNode sequence = 1 [json_name = "sequence"];. * - * @param QueryPlanNode\SequenceNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode $var * * @return $this */ @@ -71,7 +71,7 @@ public function setSequence($var) /** * Generated from protobuf field .Trace.QueryPlanNode.ParallelNode parallel = 2 [json_name = "parallel"];. * - * @return QueryPlanNode\ParallelNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode|null */ public function getParallel() { @@ -86,7 +86,7 @@ public function hasParallel() /** * Generated from protobuf field .Trace.QueryPlanNode.ParallelNode parallel = 2 [json_name = "parallel"];. * - * @param QueryPlanNode\ParallelNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode $var * * @return $this */ @@ -101,7 +101,7 @@ public function setParallel($var) /** * Generated from protobuf field .Trace.QueryPlanNode.FetchNode fetch = 3 [json_name = "fetch"];. * - * @return QueryPlanNode\FetchNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode|null */ public function getFetch() { @@ -116,7 +116,7 @@ public function hasFetch() /** * Generated from protobuf field .Trace.QueryPlanNode.FetchNode fetch = 3 [json_name = "fetch"];. * - * @param QueryPlanNode\FetchNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode $var * * @return $this */ @@ -131,7 +131,7 @@ public function setFetch($var) /** * Generated from protobuf field .Trace.QueryPlanNode.FlattenNode flatten = 4 [json_name = "flatten"];. * - * @return QueryPlanNode\FlattenNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode|null */ public function getFlatten() { @@ -146,7 +146,7 @@ public function hasFlatten() /** * Generated from protobuf field .Trace.QueryPlanNode.FlattenNode flatten = 4 [json_name = "flatten"];. * - * @param QueryPlanNode\FlattenNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode $var * * @return $this */ @@ -161,7 +161,7 @@ public function setFlatten($var) /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNode defer = 5 [json_name = "defer"];. * - * @return QueryPlanNode\DeferNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode|null */ public function getDefer() { @@ -176,7 +176,7 @@ public function hasDefer() /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNode defer = 5 [json_name = "defer"];. * - * @param QueryPlanNode\DeferNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode $var * * @return $this */ @@ -191,7 +191,7 @@ public function setDefer($var) /** * Generated from protobuf field .Trace.QueryPlanNode.ConditionNode condition = 6 [json_name = "condition"];. * - * @return QueryPlanNode\ConditionNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode|null */ public function getCondition() { @@ -206,7 +206,7 @@ public function hasCondition() /** * Generated from protobuf field .Trace.QueryPlanNode.ConditionNode condition = 6 [json_name = "condition"];. * - * @param QueryPlanNode\ConditionNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php index 6f98d789d..82e29563d 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -25,7 +26,7 @@ class DeferNode extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var DeferNodePrimary $primary + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary $primary * @var array<\Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferredNode>|\Google\Protobuf\Internal\RepeatedField $deferred * } */ @@ -38,7 +39,7 @@ public function __construct($data = null) /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNodePrimary primary = 1 [json_name = "primary"];. * - * @return DeferNodePrimary|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary|null */ public function getPrimary() { @@ -58,7 +59,7 @@ public function clearPrimary() /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNodePrimary primary = 1 [json_name = "primary"];. * - * @param DeferNodePrimary $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary $var * * @return $this */ @@ -89,7 +90,7 @@ public function getDeferred() */ public function setDeferred($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, DeferredNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, DeferredNode::class); $this->deferred = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php index c91849ea0..464bab61f 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -60,7 +61,7 @@ public function getDepends() */ public function setDepends($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, DeferredNodeDepends::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, DeferredNodeDepends::class); $this->depends = $arr; return $this; @@ -110,7 +111,7 @@ public function getPath() */ public function setPath($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ResponsePathElement::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ResponsePathElement::class); $this->path = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php index 827b72c8f..5cf9373d1 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -55,7 +56,7 @@ public function getResponsePath() */ public function setResponsePath($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ResponsePathElement::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ResponsePathElement::class); $this->response_path = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php index 6940b590b..472cad00d 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -50,7 +51,7 @@ public function getNodes() */ public function setNodes($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); $this->nodes = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php index 8cd720821..f5d30ff5c 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -50,7 +51,7 @@ public function getNodes() */ public function setNodes($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); $this->nodes = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/TracesAndStats.php b/src/Tracing/FederatedTracing/Proto/TracesAndStats.php index 9f6a4eb10..f4c4c26e8 100644 --- a/src/Tracing/FederatedTracing/Proto/TracesAndStats.php +++ b/src/Tracing/FederatedTracing/Proto/TracesAndStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -71,7 +72,7 @@ class TracesAndStats extends \Google\Protobuf\Internal\Message * This field is used to validate that the algorithm used to construct `stats_with_context` * matches similar algorithms in Apollo's servers. It is otherwise ignored and should not * be included in reports. - * @var QueryMetadata $query_metadata + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata $query_metadata * This is an optional field that is used to provide more context to the key of this object within the * traces_per_query map. If it's omitted, we assume the key is a standard operation name and signature key. * } @@ -101,7 +102,7 @@ public function getTrace() */ public function setTrace($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Trace::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Trace::class); $this->trace = $arr; return $this; @@ -126,7 +127,7 @@ public function getStatsWithContext() */ public function setStatsWithContext($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ContextualizedStats::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ContextualizedStats::class); $this->stats_with_context = $arr; return $this; @@ -165,7 +166,7 @@ public function getReferencedFieldsByType() */ public function setReferencedFieldsByType($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, ReferencedFieldsForType::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, ReferencedFieldsForType::class); $this->referenced_fields_by_type = $arr; return $this; @@ -198,7 +199,7 @@ public function getInternalTracesContributingToStats() */ public function setInternalTracesContributingToStats($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Trace::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Trace::class); $this->internal_traces_contributing_to_stats = $arr; return $this; @@ -210,7 +211,7 @@ public function setInternalTracesContributingToStats($var) * * Generated from protobuf field .QueryMetadata query_metadata = 5 [json_name = "queryMetadata"]; * - * @return QueryMetadata|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata|null */ public function getQueryMetadata() { @@ -233,7 +234,7 @@ public function clearQueryMetadata() * * Generated from protobuf field .QueryMetadata query_metadata = 5 [json_name = "queryMetadata"]; * - * @param QueryMetadata $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/TypeStat.php b/src/Tracing/FederatedTracing/Proto/TypeStat.php index 052c751fa..22bdafa2b 100644 --- a/src/Tracing/FederatedTracing/Proto/TypeStat.php +++ b/src/Tracing/FederatedTracing/Proto/TypeStat.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -57,7 +58,7 @@ public function getPerFieldStat() */ public function setPerFieldStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, FieldStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, FieldStat::class); $this->per_field_stat = $arr; return $this; diff --git a/tests/Unit/Schema/Types/Scalars/DateScalarTestBase.php b/tests/Unit/Schema/Types/Scalars/DateScalarTestBase.php index 4d2629990..acda6e379 100644 --- a/tests/Unit/Schema/Types/Scalars/DateScalarTestBase.php +++ b/tests/Unit/Schema/Types/Scalars/DateScalarTestBase.php @@ -32,6 +32,13 @@ public function testThrowsIfParseValueInvalidDate(mixed $value): void $dateScalar->parseValue($value); } + public function testReturnsIlluminateSupportCarbonAsIs(): void + { + $this->assertTrue( + $this->scalarInstance()->parseValue(IlluminateCarbon::now())->isValid(), + ); + } + public function testConvertsCarbonCarbonToIlluminateSupportCarbon(): void { $this->assertTrue(