diff --git a/dictionary.txt b/dictionary.txt index 2a4110b3b19..377bcb7c39a 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -5,7 +5,6 @@ accessibilities agrc Alderaan Andi -andimarek ASPDEPR004 ASPDEPR008 aspnetcore @@ -19,6 +18,7 @@ bananacakepop bbox BCPROCKS bfnrt +birthdates blazor blazorwasm Brontie @@ -52,12 +52,14 @@ EPSG esque evolvability Fanout +FFFFFFFZ fffzzz fieldset FIPS foos fricking frontends +Fzzz GEOGCS Giroux GraphiQL diff --git a/src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/TypeExtensions.cs b/src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/TypeExtensions.cs index 4802e29142e..1c3799a21ff 100644 --- a/src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/TypeExtensions.cs +++ b/src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/TypeExtensions.cs @@ -181,8 +181,13 @@ private static bool TryGetJsonSchemaFormat( format = scalarType.SpecifiedBy?.OriginalString switch { - "https://scalars.graphql.org/andimarek/date-time.html" => Formats.DateTime, - "https://scalars.graphql.org/andimarek/local-date.html" => Formats.Date, + "https://scalars.graphql.org/chillicream/date.html" => Formats.Date, + "https://scalars.graphql.org/chillicream/date-time.html" => Formats.DateTime, + "https://scalars.graphql.org/chillicream/local-date.html" => Formats.Date, + "https://scalars.graphql.org/chillicream/time-span.html" => Formats.Duration, + "https://scalars.graphql.org/chillicream/uuid.html" => Formats.Uuid, + "https://scalars.graphql.org/chillicream/uri.html" => Formats.Uri, + "https://scalars.graphql.org/chillicream/url.html" => Formats.Uri, _ => null }; @@ -201,10 +206,22 @@ private static bool TryGetJsonSchemaPattern( pattern = scalarType.SpecifiedBy?.OriginalString switch { - "https://scalars.graphql.org/andimarek/date-time.html" - => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,7})?(?:[Zz]|[+-]\d{2}:\d{2})$", - "https://scalars.graphql.org/andimarek/local-date.html" + "https://scalars.graphql.org/chillicream/base64-string.html" + => @"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", + "https://scalars.graphql.org/chillicream/date.html" => @"^\d{4}-\d{2}-\d{2}$", + "https://scalars.graphql.org/chillicream/date-time.html" + => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:[Zz]|[+-]\d{2}:\d{2})$", + "https://scalars.graphql.org/chillicream/local-date.html" + => @"^\d{4}-\d{2}-\d{2}$", + "https://scalars.graphql.org/chillicream/local-date-time.html" + => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$", + "https://scalars.graphql.org/chillicream/local-time.html" + => @"^\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$", + "https://scalars.graphql.org/chillicream/time-span.html" + => @"^-?P(?:\d+W|(?=\d|T(?:\d|$))(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?)$", + "https://scalars.graphql.org/chillicream/uuid.html" + => @"^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$", _ => null }; diff --git a/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs b/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs index 0d4d4f2a6d3..ba1958a1eaa 100644 --- a/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs +++ b/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs @@ -526,8 +526,13 @@ private static OpenApiSchema CreateScalarSchema(IScalarTypeDefinition scalarType { var format = scalarType.SpecifiedBy?.OriginalString switch { - "https://scalars.graphql.org/andimarek/date-time.html" => "date-time", - "https://scalars.graphql.org/andimarek/local-date.html" => "date", + "https://scalars.graphql.org/chillicream/date.html" => "date", + "https://scalars.graphql.org/chillicream/date-time.html" => "date-time", + "https://scalars.graphql.org/chillicream/local-date.html" => "date", + "https://scalars.graphql.org/chillicream/time-span.html" => "duration", + "https://scalars.graphql.org/chillicream/uuid.html" => "uuid", + "https://scalars.graphql.org/chillicream/uri.html" => "uri", + "https://scalars.graphql.org/chillicream/url.html" => "uri", _ => null }; @@ -550,10 +555,22 @@ private static OpenApiSchema CreateScalarSchema(IScalarTypeDefinition scalarType { var pattern = scalarType.SpecifiedBy?.OriginalString switch { - "https://scalars.graphql.org/andimarek/date-time.html" - => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,7})?(?:[Zz]|[+-]\d{2}:\d{2})$", - "https://scalars.graphql.org/andimarek/local-date.html" + "https://scalars.graphql.org/chillicream/base64-string.html" + => @"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", + "https://scalars.graphql.org/chillicream/date.html" => @"^\d{4}-\d{2}-\d{2}$", + "https://scalars.graphql.org/chillicream/date-time.html" + => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:[Zz]|[+-]\d{2}:\d{2})$", + "https://scalars.graphql.org/chillicream/local-date.html" + => @"^\d{4}-\d{2}-\d{2}$", + "https://scalars.graphql.org/chillicream/local-date-time.html" + => @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$", + "https://scalars.graphql.org/chillicream/local-time.html" + => @"^\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$", + "https://scalars.graphql.org/chillicream/time-span.html" + => @"^-?P(?:\d+W|(?=\d|T(?:\d|$))(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?)$", + "https://scalars.graphql.org/chillicream/uuid.html" + => @"^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$", _ => null }; diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/Extensions/TypeExtensionsTests.cs b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/Extensions/TypeExtensionsTests.cs index dc5e32de741..f8409472d81 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/Extensions/TypeExtensionsTests.cs +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/Extensions/TypeExtensionsTests.cs @@ -51,8 +51,8 @@ public void ToJsonSchemaBuilder_ValidValues_MatchPattern(Type type, string value [InlineData(typeof(DateTimeType), "2011-08-30")] // Seconds are not allowed for the offset. [InlineData(typeof(DateTimeType), "2011-08-30T13:22:53.108+03:30:15")] - // A DateTime with 8 fractional digits. - [InlineData(typeof(DateTimeType), "2011-08-30T13:22:53.12345678+03:30")] + // A DateTime with 10 fractional digits. + [InlineData(typeof(DateTimeType), "2011-08-30T13:22:53.1234567890+03:30")] [InlineData(typeof(LocalDateTimeType), "2018/06/11T08:46:14 pm")] [InlineData(typeof(LocalDateTimeType), "abc")] [InlineData(typeof(LocalTimeType), "08:46:14 pm")] diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithDefaultedVariables_ReturnsExpectedResult.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithDefaultedVariables_ReturnsExpectedResult.json index daf4ea95e52..225de9181bc 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithDefaultedVariables_ReturnsExpectedResult.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithDefaultedVariables_ReturnsExpectedResult.json @@ -8,7 +8,7 @@ "boolean": true, "byte": 1, "date": "2000-01-01", - "dateTime": "2000-01-01T12:00:00.000Z", + "dateTime": "2000-01-01T12:00:00Z", "decimal": 79228162514264337593543950335, "enum": "VALUE1", "float": 1.5, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithNonNullableVariables_ReturnsExpectedResult.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithNonNullableVariables_ReturnsExpectedResult.json index 9a4891be25e..a6c5ae26c17 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithNonNullableVariables_ReturnsExpectedResult.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/IntegrationTestBase.CallTool_GetWithNonNullableVariables_ReturnsExpectedResult.json @@ -8,7 +8,7 @@ "boolean": true, "byte": 1, "date": "2000-01-01", - "dateTime": "2000-01-01T12:00:00.000Z", + "dateTime": "2000-01-01T12:00:00Z", "decimal": 79228162514264337593543950335, "enum": "VALUE1", "float": 1.5, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Input.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Input.json index 4b48515b46c..434d002b175 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Input.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Input.json @@ -19,7 +19,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description", "default": "12:00:00" } @@ -76,7 +76,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description", "default": "12:00:00" } @@ -157,7 +157,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description", "default": "12:00:00" } diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Output.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Output.json index c9687abd170..f0ec0ff61d4 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Output.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithComplexVariables_CreatesCorrectSchema_Output.json @@ -28,7 +28,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -69,7 +69,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -130,7 +130,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Input.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Input.json index 91da3630a97..d6e89cce315 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Input.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Input.json @@ -33,6 +33,7 @@ }, "date": { "type": "string", + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "Date description", "default": "2000-01-01" @@ -40,7 +41,7 @@ "dateTime": { "type": "string", "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "description": "DateTime description", "default": "2000-01-01T12:00:00Z" }, @@ -95,13 +96,13 @@ }, "localDateTime": { "type": "string", - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalDateTime description", "default": "2000-01-01T12:00:00" }, "localTime": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalTime description", "default": "12:00:00" }, @@ -121,7 +122,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description", "default": "12:00:00" } @@ -164,6 +165,7 @@ }, "timeSpan": { "type": "string", + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "description": "TimeSpan description", "default": "PT5M" @@ -175,16 +177,19 @@ }, "uri": { "type": "string", + "format": "uri", "description": "URI description", "default": "https://example.com" }, "url": { "type": "string", + "format": "uri", "description": "URL description", "default": "https://example.com" }, "uuid": { "type": "string", + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", "description": "UUID description", "default": "00000000-0000-0000-0000-000000000000" diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Output.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Output.json index 70ca96e8d2d..190b3d51b32 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Output.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithDefaultedVariables_CreatesCorrectSchema_Output.json @@ -32,12 +32,13 @@ }, "date": { "type": "string", + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "dateTime": { "type": "string", "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" }, "decimal": { "type": "number" @@ -74,11 +75,11 @@ }, "localDateTime": { "type": "string", - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "localTime": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "long": { "type": "integer" @@ -94,7 +95,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -125,19 +126,23 @@ }, "timeSpan": { "type": "string", + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$" }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "format": "uri" }, "url": { - "type": "string" + "type": "string", + "format": "uri" }, "uuid": { "type": "string", + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$" } }, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Input.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Input.json index 39751dc48dd..07c8bd03ff8 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Input.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Input.json @@ -27,13 +27,14 @@ }, "date": { "type": "string", + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "Date description" }, "dateTime": { "type": "string", "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "description": "DateTime description" }, "decimal": { @@ -78,12 +79,12 @@ }, "localDateTime": { "type": "string", - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalDateTime description" }, "localTime": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalTime description" }, "long": { @@ -101,7 +102,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -132,6 +133,7 @@ }, "timeSpan": { "type": "string", + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "description": "TimeSpan description" }, @@ -141,14 +143,17 @@ }, "uri": { "type": "string", + "format": "uri", "description": "URI description" }, "url": { "type": "string", + "format": "uri", "description": "URL description" }, "uuid": { "type": "string", + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", "description": "UUID description" } diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Output.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Output.json index d48fac684da..1ed8c6a610b 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Output.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNonNullableVariables_CreatesCorrectSchema_Output.json @@ -32,12 +32,13 @@ }, "date": { "type": "string", + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "dateTime": { "type": "string", "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" }, "decimal": { "type": "number" @@ -74,11 +75,11 @@ }, "localDateTime": { "type": "string", - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "localTime": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "long": { "type": "integer" @@ -94,7 +95,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -125,19 +126,23 @@ }, "timeSpan": { "type": "string", + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$" }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "format": "uri" }, "url": { - "type": "string" + "type": "string", + "format": "uri" }, "uuid": { "type": "string", + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$" } }, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Input.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Input.json index caa3144a745..ffb766b9af4 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Input.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Input.json @@ -40,6 +40,7 @@ "string", "null" ], + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "Date description" }, @@ -49,7 +50,7 @@ "null" ], "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "description": "DateTime description" }, "decimal": { @@ -120,7 +121,7 @@ "string", "null" ], - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalDateTime description" }, "localTime": { @@ -128,7 +129,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "LocalTime description" }, "long": { @@ -161,7 +162,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -195,6 +196,7 @@ "string", "null" ], + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "description": "TimeSpan description" }, @@ -210,6 +212,7 @@ "string", "null" ], + "format": "uri", "description": "URI description" }, "url": { @@ -217,6 +220,7 @@ "string", "null" ], + "format": "uri", "description": "URL description" }, "uuid": { @@ -224,6 +228,7 @@ "string", "null" ], + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", "description": "UUID description" } diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Output.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Output.json index 11b3c4016b5..89c13cd388c 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Output.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithNullableVariables_CreatesCorrectSchema_Output.json @@ -45,6 +45,7 @@ "string", "null" ], + "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "dateTime": { @@ -53,7 +54,7 @@ "null" ], "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$" }, "decimal": { "type": [ @@ -116,14 +117,14 @@ "string", "null" ], - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "localTime": { "type": [ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$" + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$" }, "long": { "type": [ @@ -154,7 +155,7 @@ "string", "null" ], - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -194,6 +195,7 @@ "string", "null" ], + "format": "duration", "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$" }, "unknown": { @@ -206,19 +208,22 @@ "type": [ "string", "null" - ] + ], + "format": "uri" }, "url": { "type": [ "string", "null" - ] + ], + "format": "uri" }, "uuid": { "type": [ "string", "null" ], + "format": "uuid", "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$" } }, diff --git a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithSkipAndInclude_CreatesCorrectOutputSchema.json b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithSkipAndInclude_CreatesCorrectOutputSchema.json index 5e7fa202e71..4fc5e4e2e4c 100644 --- a/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithSkipAndInclude_CreatesCorrectOutputSchema.json +++ b/src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/__snapshots__/OperationToolFactoryTests.CreateTool_WithSkipAndInclude_CreatesCorrectOutputSchema.json @@ -45,7 +45,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -79,7 +79,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -113,7 +113,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, @@ -147,7 +147,7 @@ "properties": { "field1C": { "type": "string", - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "description": "field1C description" } }, diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/Endpoints/__snapshots__/HttpEndpointIntegrationTestBase.Http_Post_Complex_Object.snap b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/Endpoints/__snapshots__/HttpEndpointIntegrationTestBase.Http_Post_Complex_Object.snap index 6c8f39052c9..03ac99a6790 100644 --- a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/Endpoints/__snapshots__/HttpEndpointIntegrationTestBase.Http_Post_Complex_Object.snap +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/Endpoints/__snapshots__/HttpEndpointIntegrationTestBase.Http_Post_Complex_Object.snap @@ -3,4 +3,4 @@ Content-Type: application/json --------------------------> Status Code: OK --------------------------> -{"any":{"key":"value"},"base64String":"dGVzdA==","boolean":true,"byte":1,"date":"2000-01-01","dateTime":"2000-01-01T12:00:00.000Z","decimal":79228162514264337593543950335,"enum":"VALUE1","float":1.5,"id":"test","int":1,"json":{"key":"value"},"list":["test"],"localDate":"2000-01-01","localDateTime":"2000-01-01T12:00:00","localTime":"12:00:00","long":9223372036854775807,"object":{"field1A":{"field1B":{"field1C":"12:00:00"}}},"short":1,"string":"test","timeSpan":"PT5M","unknown":"test","url":"https://example.com/","uuid":"00000000-0000-0000-0000-000000000000"} +{"any":{"key":"value"},"base64String":"dGVzdA==","boolean":true,"byte":1,"date":"2000-01-01","dateTime":"2000-01-01T12:00:00Z","decimal":79228162514264337593543950335,"enum":"VALUE1","float":1.5,"id":"test","int":1,"json":{"key":"value"},"list":["test"],"localDate":"2000-01-01","localDateTime":"2000-01-01T12:00:00","localTime":"12:00:00","long":9223372036854775807,"object":{"field1A":{"field1B":{"field1C":"12:00:00"}}},"short":1,"string":"test","timeSpan":"PT5M","unknown":"test","url":"https://example.com/","uuid":"00000000-0000-0000-0000-000000000000"} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0.json index e877d4d1087..80502219b0f 100644 --- a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0.json +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0.json @@ -66,34 +66,37 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", - "type": "string" + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": "boolean" }, "byte": { "type": "integer", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", "format": "int32" }, "date": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" }, "dateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", "format": "date-time" }, "decimal": { "type": "number", - "description": "The `Decimal` scalar type represents a decimal floating-point number.", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision.", "format": "float" }, "enum": { @@ -141,7 +144,8 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": "array", @@ -152,22 +156,22 @@ "localDate": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", "format": "date" }, "localDateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": "integer", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "description": "The `Long` scalar type represents a signed 64-bit integer.", "format": "int32" }, "object": { @@ -189,7 +193,7 @@ "type": "object", "properties": { "field1C": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", "description": "field1C description" } @@ -203,7 +207,7 @@ }, "short": { "type": "integer", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.", + "description": "The `Short` scalar type represents a signed 16-bit integer.", "format": "int32" }, "string": { @@ -212,20 +216,27 @@ "timeSpan": { "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time.", + "format": "duration" }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986.", + "format": "uri" }, "url": { - "type": "string" + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" }, "uuid": { "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", - "type": "string" + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" } } } @@ -287,14 +298,16 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", "type": [ "null", "string" - ] + ], + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": [ @@ -307,7 +320,7 @@ "null", "integer" ], - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", "format": "int32" }, "date": { @@ -316,15 +329,16 @@ "null", "string" ], - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" }, "dateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "type": [ "null", "string" ], - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", "format": "date-time" }, "decimal": { @@ -332,7 +346,7 @@ "null", "number" ], - "description": "The `Decimal` scalar type represents a decimal floating-point number.", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision.", "format": "float" }, "enum": { @@ -389,7 +403,8 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": [ @@ -409,31 +424,31 @@ "null", "string" ], - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", "format": "date" }, "localDateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": [ "null", "string" ], - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": [ "null", "string" ], - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": [ "null", "integer" ], - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "description": "The `Long` scalar type represents a signed 64-bit integer.", "format": "int32" }, "object": { @@ -464,12 +479,12 @@ ], "properties": { "field1C": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": [ "null", "string" ], - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." } } } @@ -482,7 +497,7 @@ "null", "integer" ], - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.", + "description": "The `Short` scalar type represents a signed 16-bit integer.", "format": "int32" }, "string": { @@ -497,7 +512,8 @@ "null", "string" ], - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time.", + "format": "duration" }, "unknown": { "type": [ @@ -509,14 +525,18 @@ "type": [ "null", "string" - ] + ], + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" }, "uuid": { "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", "type": [ "null", "string" - ] + ], + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" } } } diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0_Fusion.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0_Fusion.json index dd9a6500e84..e3187fdf88a 100644 --- a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0_Fusion.json +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0_Fusion.json @@ -47,29 +47,31 @@ "type": "object", "properties": { "any": { - "type": "string" + "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { - "type": "string" + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": "boolean" }, "byte": { "type": "string", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127." + "description": "The `Byte` scalar type represents a signed 8-bit integer." }, "date": { "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC." }, "dateTime": { "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." + "description": "The `DateTime` scalar type represents a date and time with time zone offset information." }, "decimal": { "type": "string", - "description": "The `Decimal` scalar type represents a decimal floating-point number." + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." }, "enum": { "enum": [ @@ -97,7 +99,8 @@ "format": "int32" }, "json": { - "type": "string" + "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": "array", @@ -107,19 +110,19 @@ }, "localDate": { "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." + "description": "The `LocalDate` scalar type represents a date without time or time zone information." }, "localDateTime": { "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": "string", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." + "description": "The `Long` scalar type represents a signed 64-bit integer." }, "object": { "required": [ @@ -153,26 +156,29 @@ }, "short": { "type": "string", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." + "description": "The `Short` scalar type represents a signed 16-bit integer." }, "string": { "type": "string" }, "timeSpan": { "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time." }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." }, "url": { - "type": "string" + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." }, "uuid": { - "type": "string" + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." } } } @@ -218,13 +224,15 @@ "type": [ "null", "string" - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { "type": [ "null", "string" - ] + ], + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": [ @@ -237,28 +245,28 @@ "null", "string" ], - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127." + "description": "The `Byte` scalar type represents a signed 8-bit integer." }, "date": { "type": [ "null", "string" ], - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC." }, "dateTime": { "type": [ "null", "string" ], - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." + "description": "The `DateTime` scalar type represents a date and time with time zone offset information." }, "decimal": { "type": [ "null", "string" ], - "description": "The `Decimal` scalar type represents a decimal floating-point number." + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." }, "enum": { "enum": [ @@ -298,7 +306,8 @@ "type": [ "null", "string" - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": [ @@ -317,28 +326,28 @@ "null", "string" ], - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." + "description": "The `LocalDate` scalar type represents a date without time or time zone information." }, "localDateTime": { "type": [ "null", "string" ], - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { "type": [ "null", "string" ], - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": [ "null", "string" ], - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." + "description": "The `Long` scalar type represents a signed 64-bit integer." }, "object": { "required": [ @@ -372,7 +381,7 @@ "null", "string" ], - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." } } } @@ -385,7 +394,7 @@ "null", "string" ], - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." + "description": "The `Short` scalar type represents a signed 16-bit integer." }, "string": { "type": [ @@ -398,7 +407,7 @@ "null", "string" ], - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time." }, "unknown": { "type": [ @@ -410,13 +419,15 @@ "type": [ "null", "string" - ] + ], + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." }, "uuid": { "type": [ "null", "string" - ] + ], + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." } } } diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0.json index e75a041fec9..4db15a204ed 100644 --- a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0.json +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0.json @@ -61,34 +61,37 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", - "type": "string" + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": "boolean" }, "byte": { "type": "integer", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", "format": "int32" }, "date": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" }, "dateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", "format": "date-time" }, "decimal": { "type": "number", - "description": "The `Decimal` scalar type represents a decimal floating-point number.", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision.", "format": "float" }, "enum": { @@ -136,7 +139,8 @@ { "type": "array" } - ] + ], + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": "array", @@ -147,22 +151,22 @@ "localDate": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", "format": "date" }, "localDateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": "integer", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "description": "The `Long` scalar type represents a signed 64-bit integer.", "format": "int32" }, "object": { @@ -184,7 +188,7 @@ "type": "object", "properties": { "field1C": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", "description": "field1C description" } @@ -198,7 +202,7 @@ }, "short": { "type": "integer", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.", + "description": "The `Short` scalar type represents a signed 16-bit integer.", "format": "int32" }, "string": { @@ -207,20 +211,27 @@ "timeSpan": { "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time.", + "format": "duration" }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986.", + "format": "uri" }, "url": { - "type": "string" + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" }, "uuid": { "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", - "type": "string" + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" } } } @@ -283,11 +294,13 @@ "type": "array" } ], + "description": "The `Any` scalar type represents any valid GraphQL value.", "nullable": true }, "base64String": { "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string.", "nullable": true }, "boolean": { @@ -296,26 +309,27 @@ }, "byte": { "type": "integer", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", "format": "int32", "nullable": true }, "date": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type.", + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date", "nullable": true }, "dateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,7})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", "format": "date-time", "nullable": true }, "decimal": { "type": "number", - "description": "The `Decimal` scalar type represents a decimal floating-point number.", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision.", "format": "float", "nullable": true }, @@ -369,6 +383,7 @@ "type": "array" } ], + "description": "The `Any` scalar type represents any valid GraphQL value.", "nullable": true }, "list": { @@ -382,25 +397,25 @@ "localDate": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", "format": "date", "nullable": true }, "localDateTime": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`.", + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information.", "nullable": true }, "localTime": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information.", "nullable": true }, "long": { "type": "integer", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "description": "The `Long` scalar type represents a signed 64-bit integer.", "format": "int32", "nullable": true }, @@ -423,9 +438,9 @@ "type": "object", "properties": { "field1C": { - "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information.", "nullable": true } }, @@ -439,7 +454,7 @@ }, "short": { "type": "integer", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.", + "description": "The `Short` scalar type represents a signed 16-bit integer.", "format": "int32", "nullable": true }, @@ -450,7 +465,8 @@ "timeSpan": { "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type.", + "description": "The `TimeSpan` scalar type represents a duration of time.", + "format": "duration", "nullable": true }, "unknown": { @@ -459,11 +475,15 @@ }, "url": { "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri", "nullable": true }, "uuid": { "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid", "nullable": true } } diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0_Fusion.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0_Fusion.json index ef88d786f44..5a1497b9653 100644 --- a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0_Fusion.json +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET9_0_Fusion.json @@ -42,29 +42,31 @@ "type": "object", "properties": { "any": { - "type": "string" + "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value." }, "base64String": { - "type": "string" + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." }, "boolean": { "type": "boolean" }, "byte": { "type": "string", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127." + "description": "The `Byte` scalar type represents a signed 8-bit integer." }, "date": { "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type." + "description": "The `Date` scalar type represents a date in UTC." }, "dateTime": { "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." + "description": "The `DateTime` scalar type represents a date and time with time zone offset information." }, "decimal": { "type": "string", - "description": "The `Decimal` scalar type represents a decimal floating-point number." + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." }, "enum": { "enum": [ @@ -92,7 +94,8 @@ "format": "int32" }, "json": { - "type": "string" + "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value." }, "list": { "type": "array", @@ -102,19 +105,19 @@ }, "localDate": { "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." + "description": "The `LocalDate` scalar type represents a date without time or time zone information." }, "localDateTime": { "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." }, "localTime": { "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." }, "long": { "type": "string", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." + "description": "The `Long` scalar type represents a signed 64-bit integer." }, "object": { "required": [ @@ -148,26 +151,29 @@ }, "short": { "type": "string", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." + "description": "The `Short` scalar type represents a signed 16-bit integer." }, "string": { "type": "string" }, "timeSpan": { "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type." + "description": "The `TimeSpan` scalar type represents a duration of time." }, "unknown": { "type": "string" }, "uri": { - "type": "string" + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." }, "url": { - "type": "string" + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." }, "uuid": { - "type": "string" + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." } } } @@ -211,10 +217,12 @@ "properties": { "any": { "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value.", "nullable": true }, "base64String": { "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string.", "nullable": true }, "boolean": { @@ -223,22 +231,22 @@ }, "byte": { "type": "string", - "description": "The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", "nullable": true }, "date": { "type": "string", - "description": "The `Date` scalar represents an ISO-8601 compliant date type.", + "description": "The `Date` scalar type represents a date in UTC.", "nullable": true }, "dateTime": { "type": "string", - "description": "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", "nullable": true }, "decimal": { "type": "string", - "description": "The `Decimal` scalar type represents a decimal floating-point number.", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision.", "nullable": true }, "enum": { @@ -272,6 +280,7 @@ }, "json": { "type": "string", + "description": "The `Any` scalar type represents any valid GraphQL value.", "nullable": true }, "list": { @@ -284,22 +293,22 @@ }, "localDate": { "type": "string", - "description": "The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", "nullable": true }, "localDateTime": { "type": "string", - "description": "The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`.", + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information.", "nullable": true }, "localTime": { "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information.", "nullable": true }, "long": { "type": "string", - "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "description": "The `Long` scalar type represents a signed 64-bit integer.", "nullable": true }, "object": { @@ -322,7 +331,7 @@ "properties": { "field1C": { "type": "string", - "description": "The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information.", "nullable": true } }, @@ -336,7 +345,7 @@ }, "short": { "type": "string", - "description": "The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.", + "description": "The `Short` scalar type represents a signed 16-bit integer.", "nullable": true }, "string": { @@ -345,7 +354,7 @@ }, "timeSpan": { "type": "string", - "description": "The `TimeSpan` scalar represents an ISO-8601 compliant duration type.", + "description": "The `TimeSpan` scalar type represents a duration of time.", "nullable": true }, "unknown": { @@ -354,10 +363,12 @@ }, "url": { "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", "nullable": true }, "uuid": { "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", "nullable": true } } diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap index 6e306458850..c4b0b05e436 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap @@ -128,10 +128,14 @@ directive @foo(bar: Int!) on SUBSCRIPTION "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize("The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." assumedSize: Int "The `slicingArguments` argument can be used to define which of the field's arguments with numeric type are slicing arguments, so that their value determines the size of the list returned by that field. It may specify a list of multiple slicing arguments." slicingArguments: [String!] "The `slicingArgumentDefaultValue` argument can be used to define a default value for a slicing argument, which is used if the argument is not present in a query." slicingArgumentDefaultValue: Int "The `sizedFields` argument can be used to define that the value of the `assumedSize` argument or of a slicing argument does not affect the size of a list returned by a field itself, but that of a list returned by one of its sub-fields." sizedFields: [String!] "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap index f3fa98b3db9..64950133b0d 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap @@ -126,10 +126,14 @@ directive @defer("If this argument label has a value other than null, it will be "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize("The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." assumedSize: Int "The `slicingArguments` argument can be used to define which of the field's arguments with numeric type are slicing arguments, so that their value determines the size of the list returned by that field. It may specify a list of multiple slicing arguments." slicingArguments: [String!] "The `slicingArgumentDefaultValue` argument can be used to define a default value for a slicing argument, which is used if the argument is not present in a query." slicingArgumentDefaultValue: Int "The `sizedFields` argument can be used to define that the value of the `assumedSize` argument or of a slicing argument does not affect the size of a list returned by a field itself, but that of a list returned by one of its sub-fields." sizedFields: [String!] "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap index f3fa98b3db9..64950133b0d 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap @@ -126,10 +126,14 @@ directive @defer("If this argument label has a value other than null, it will be "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize("The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." assumedSize: Int "The `slicingArguments` argument can be used to define which of the field's arguments with numeric type are slicing arguments, so that their value determines the size of the list returned by that field. It may specify a list of multiple slicing arguments." slicingArguments: [String!] "The `slicingArgumentDefaultValue` argument can be used to define a default value for a slicing argument, which is used if the argument is not present in a query." slicingArgumentDefaultValue: Int "The `sizedFields` argument can be used to define that the value of the `assumedSize` argument or of a slicing argument does not affect the size of a list returned by a field itself, but that of a list returned by one of its sub-fields." sizedFields: [String!] "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md index 2125a646c56..c7f872e567f 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md @@ -139,11 +139,15 @@ directive @foo(bar: Int!) on SUBSCRIPTION "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize("The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." assumedSize: Int "The `slicingArguments` argument can be used to define which of the field's arguments with numeric type are slicing arguments, so that their value determines the size of the list returned by that field. It may specify a list of multiple slicing arguments." slicingArguments: [String!] "The `slicingArgumentDefaultValue` argument can be used to define a default value for a slicing argument, which is used if the argument is not present in a query." slicingArgumentDefaultValue: Int "The `sizedFields` argument can be used to define that the value of the `assumedSize` argument or of a slicing argument does not affect the size of a list returned by a field itself, but that of a list returned by one of its sub-fields." sizedFields: [String!] "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") ``` diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md index 892ed24ccbc..0e7d5e87aad 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md @@ -139,11 +139,15 @@ directive @foo(bar: Int!) on SUBSCRIPTION "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize("The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." assumedSize: Int "The `slicingArguments` argument can be used to define which of the field's arguments with numeric type are slicing arguments, so that their value determines the size of the list returned by that field. It may specify a list of multiple slicing arguments." slicingArguments: [String!] "The `slicingArgumentDefaultValue` argument can be used to define a default value for a slicing argument, which is used if the argument is not present in a query." slicingArgumentDefaultValue: Int "The `sizedFields` argument can be used to define that the value of the `assumedSize` argument or of a slicing argument does not affect the size of a list returned by a field itself, but that of a list returned by one of its sub-fields." sizedFields: [String!] "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") ``` diff --git a/src/HotChocolate/Core/src/Types.Abstractions/Types/Extensions/HotChocolateTypesAbstractionsScalarDefinitionExtensions.cs b/src/HotChocolate/Core/src/Types.Abstractions/Types/Extensions/HotChocolateTypesAbstractionsScalarDefinitionExtensions.cs index 99320437d09..4e8df5bbd1f 100644 --- a/src/HotChocolate/Core/src/Types.Abstractions/Types/Extensions/HotChocolateTypesAbstractionsScalarDefinitionExtensions.cs +++ b/src/HotChocolate/Core/src/Types.Abstractions/Types/Extensions/HotChocolateTypesAbstractionsScalarDefinitionExtensions.cs @@ -7,8 +7,8 @@ public static class HotChocolateTypesAbstractionsScalarDefinitionExtensions private static readonly FrozenDictionary s_serializationTypeLookup = new Dictionary { - ["https://scalars.graphql.org/andimarek/date-time.html"] = ScalarSerializationType.String, - ["https://scalars.graphql.org/andimarek/local-date.html"] = ScalarSerializationType.String + ["https://scalars.graphql.org/chillicream/date-time.html"] = ScalarSerializationType.String, + ["https://scalars.graphql.org/chillicream/local-date.html"] = ScalarSerializationType.String } .ToFrozenDictionary(); diff --git a/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs b/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs index a517fc7b1d2..31f1c63043f 100644 --- a/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs +++ b/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs @@ -68,6 +68,15 @@ internal static string AnyType_CycleInObjectGraph { } } + /// + /// Looks up a localized string similar to The `Any` scalar type represents any valid GraphQL value.. + /// + internal static string AnyType_Description { + get { + return ResourceManager.GetString("AnyType_Description", resourceCulture); + } + } + /// /// Looks up a localized string similar to An Applied Directive is an instances of a directive as applied to a schema element. This type is NOT specified by the graphql specification presently.. /// @@ -104,6 +113,15 @@ internal static string ArgumentValueBuilder_NonNull { } } + /// + /// Looks up a localized string similar to The `Base64String` scalar type represents an array of bytes encoded as a Base64 string.. + /// + internal static string Base64StringType_Description { + get { + return ResourceManager.GetString("Base64StringType_Description", resourceCulture); + } + } + /// /// Looks up a localized string similar to The specified binding cannot be handled.. /// @@ -123,7 +141,7 @@ internal static string BooleanType_Description { } /// - /// Looks up a localized string similar to The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127.. + /// Looks up a localized string similar to The `Byte` scalar type represents a signed 8-bit integer.. /// internal static string ByteType_Description { get { @@ -276,7 +294,7 @@ internal static string DataLoaderResolverContextExtensions_UnableToRegister { } /// - /// Looks up a localized string similar to The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone.. + /// Looks up a localized string similar to The `DateTime` scalar type represents a date and time with time zone offset information.. /// internal static string DateTimeType_Description { get { @@ -285,7 +303,7 @@ internal static string DateTimeType_Description { } /// - /// Looks up a localized string similar to The `Date` scalar represents an ISO-8601 compliant date type.. + /// Looks up a localized string similar to The `Date` scalar type represents a date in UTC.. /// internal static string DateType_Description { get { @@ -294,7 +312,7 @@ internal static string DateType_Description { } /// - /// Looks up a localized string similar to The `Decimal` scalar type represents a decimal floating-point number.. + /// Looks up a localized string similar to The `Decimal` scalar type represents a decimal floating-point number with high precision.. /// internal static string DecimalType_Description { get { @@ -1340,7 +1358,7 @@ internal static string IntType_Description { } /// - /// Looks up a localized string similar to The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`.. + /// Looks up a localized string similar to The `LocalDateTime` scalar type represents a date and time without time zone information.. /// internal static string LocalDateTimeType_Description { get { @@ -1349,7 +1367,7 @@ internal static string LocalDateTimeType_Description { } /// - /// Looks up a localized string similar to The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system.. + /// Looks up a localized string similar to The `LocalDate` scalar type represents a date without time or time zone information.. /// internal static string LocalDateType_Description { get { @@ -1358,7 +1376,7 @@ internal static string LocalDateType_Description { } /// - /// Looks up a localized string similar to The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.. + /// Looks up a localized string similar to The `LocalTime` scalar type represents a time of day without date or time zone information.. /// internal static string LocalTimeType_Description { get { @@ -1367,7 +1385,7 @@ internal static string LocalTimeType_Description { } /// - /// Looks up a localized string similar to The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.. + /// Looks up a localized string similar to The `Long` scalar type represents a signed 64-bit integer.. /// internal static string LongType_Description { get { @@ -2051,7 +2069,7 @@ internal static string ServiceHelper_UseResolverServiceInternal_Order { } /// - /// Looks up a localized string similar to The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.. + /// Looks up a localized string similar to The `Short` scalar type represents a signed 16-bit integer.. /// internal static string ShortType_Description { get { @@ -2609,7 +2627,7 @@ internal static string ThrowHelper_UsePagingAttribute_NodeTypeUnknown { } /// - /// Looks up a localized string similar to The `TimeSpan` scalar represents an ISO-8601 compliant duration type.. + /// Looks up a localized string similar to The `TimeSpan` scalar type represents a duration of time.. /// internal static string TimeSpanType_Description { get { @@ -2945,7 +2963,7 @@ internal static string UnionTypeExtension_CannotMerge { } /// - /// Looks up a localized string similar to The UnsignedByte scalar type represents an unsigned 8-bit numeric non-fractional value greater than or equal to 0.. + /// Looks up a localized string similar to The `UnsignedByte` scalar type represents an unsigned 8-bit integer.. /// internal static string UnsignedByteType_Description { get { @@ -2954,7 +2972,7 @@ internal static string UnsignedByteType_Description { } /// - /// Looks up a localized string similar to The UnsignedInt scalar type represents an unsigned 32-bit numeric non-fractional value greater than or equal to 0.. + /// Looks up a localized string similar to The `UnsignedInt` scalar type represents an unsigned 32-bit integer.. /// internal static string UnsignedIntType_Description { get { @@ -2963,7 +2981,7 @@ internal static string UnsignedIntType_Description { } /// - /// Looks up a localized string similar to The UnsignedLong scalar type represents an unsigned 64-bit numeric non-fractional value greater than or equal to 0.. + /// Looks up a localized string similar to The `UnsignedLong` scalar type represents an unsigned 64-bit integer.. /// internal static string UnsignedLongType_Description { get { @@ -2972,7 +2990,7 @@ internal static string UnsignedLongType_Description { } /// - /// Looks up a localized string similar to The UnsignedShort scalar type represents an unsigned 16-bit numeric non-fractional value greater than or equal to 0.. + /// Looks up a localized string similar to The `UnsignedShort` scalar type represents an unsigned 16-bit integer.. /// internal static string UnsignedShortType_Description { get { @@ -2980,6 +2998,33 @@ internal static string UnsignedShortType_Description { } } + /// + /// Looks up a localized string similar to The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986.. + /// + internal static string UriType_Description { + get { + return ResourceManager.GetString("UriType_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.. + /// + internal static string UrlType_Description { + get { + return ResourceManager.GetString("UrlType_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.. + /// + internal static string UuidType_Description { + get { + return ResourceManager.GetString("UuidType_Description", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unknown format. Guid supports the following format chars: {{ `N`, `D`, `B`, `P` }}. /// https://docs.microsoft.com/en-us/dotnet/api/system.buffers.text.utf8parser.tryparse?view=netcore-3.1#System_Buffers_Text_Utf8Parser_TryParse_System_ReadOnlySpan_System_Byte__System_Guid__System_Int32__System_Char. diff --git a/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx b/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx index b22b8904cab..65d5b3f8abf 100644 --- a/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx +++ b/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx @@ -21,12 +21,18 @@ The {0}-directive is missing the if-argument. + + The `Any` scalar type represents any valid GraphQL value. + The argument type has to be an input-type. Argument `{0}` of non-null type `{1}` must not be null. + + The `Base64String` scalar type represents an array of bytes encoded as a Base64 string. + The `Boolean` scalar type represents `true` or `false`. @@ -46,13 +52,13 @@ Unable to register a DataLoader with your DataLoader registry. - The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone. + The `DateTime` scalar type represents a date and time with time zone offset information. - The `Date` scalar represents an ISO-8601 compliant date type. + The `Date` scalar type represents a date in UTC. - The `Decimal` scalar type represents a decimal floating-point number. + The `Decimal` scalar type represents a decimal floating-point number with high precision. The specified member has to be a method or a property. @@ -216,7 +222,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. - The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1. + The `Long` scalar type represents a signed 64-bit integer. The name scalar represents a valid GraphQL name as specified in the spec and can be used to refer to fields or types. @@ -324,7 +330,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior A list of all types supported by this server. - The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1. + The `Short` scalar type represents a signed 16-bit integer. The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. @@ -480,7 +486,7 @@ Type: `{0}` The specified convention type is not supported. - The `TimeSpan` scalar represents an ISO-8601 compliant duration type. + The `TimeSpan` scalar type represents a duration of time. The DataLoader `{0}` was not of the requested type `{1}`. @@ -979,13 +985,13 @@ Type: `{0}` Cycle in object graph detected. - The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`. + The `LocalDateTime` scalar type represents a date and time without time zone information. - The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system. + The `LocalDate` scalar type represents a date without time or time zone information. - The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss. + The `LocalTime` scalar type represents a time of day without date or time zone information. The type `System.Object` cannot be implicitly bound to a schema type. @@ -1000,19 +1006,28 @@ Type: `{0}` The runtime value `{0}` of the scalar `{1}` has an invalid format. - The Byte scalar type represents an 8-bit signed integer with a minimum value of -128 and a maximum value of 127. + The `Byte` scalar type represents a signed 8-bit integer. - The UnsignedByte scalar type represents an unsigned 8-bit numeric non-fractional value greater than or equal to 0. + The `UnsignedByte` scalar type represents an unsigned 8-bit integer. - The UnsignedShort scalar type represents an unsigned 16-bit numeric non-fractional value greater than or equal to 0. + The `UnsignedShort` scalar type represents an unsigned 16-bit integer. - The UnsignedInt scalar type represents an unsigned 32-bit numeric non-fractional value greater than or equal to 0. + The `UnsignedInt` scalar type represents an unsigned 32-bit integer. - The UnsignedLong scalar type represents an unsigned 64-bit numeric non-fractional value greater than or equal to 0. + The `UnsignedLong` scalar type represents an unsigned 64-bit integer. + + + The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986. + + + The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986. + + + The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562. {0}Type cannot parse the provided value. The value does not match the required regular expression pattern. diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/AnyType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/AnyType.cs index 23d59e6c77a..2420eb53f74 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/AnyType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/AnyType.cs @@ -4,20 +4,22 @@ using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.Language.Visitors; +using HotChocolate.Properties; using HotChocolate.Text.Json; using static HotChocolate.Utilities.ThrowHelper; namespace HotChocolate.Types; /// -/// -/// The JSON scalar type represents a JSON node which can be a string, -/// a number a boolean, an array, an object or null. -/// -/// The runtime representation of the JSON scalar is an . +/// The Any scalar type represents any valid GraphQL value. It is intended for scenarios +/// where the type of data is dynamic or not known at schema definition time, such as configuration +/// objects, metadata, flexible schemas, or polymorphic data structures. /// +/// Specification public sealed class AnyType : ScalarType { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/any.html"; + /// /// Initializes a new instance of . /// @@ -28,6 +30,7 @@ public AnyType( : base(name, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// @@ -35,7 +38,10 @@ public AnyType( /// [ActivatorUtilitiesConstructor] public AnyType() - : this(ScalarNames.Any, bind: BindingBehavior.Implicit) + : this( + ScalarNames.Any, + TypeResources.AnyType_Description, + BindingBehavior.Implicit) { } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/Base64StringType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/Base64StringType.cs index 3a773f586cb..683e871a945 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/Base64StringType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/Base64StringType.cs @@ -4,16 +4,21 @@ using HotChocolate.Buffers; using HotChocolate.Features; using HotChocolate.Language; +using HotChocolate.Properties; using HotChocolate.Text.Json; namespace HotChocolate.Types; /// -/// Represents a scalar type for byte arrays that are serialized as Base64-encoded strings in GraphQL. -/// This type handles the conversion between byte arrays in .NET and string representations in GraphQL schemas. +/// The Base64String scalar type represents an array of bytes encoded as a Base64 string. It +/// is intended for scenarios where binary data needs to be transmitted, such as file contents, +/// cryptographic keys, image data, or any arbitrary binary data. /// +/// Specification public class Base64StringType : ScalarType { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/base64-string.html"; + /// /// Initializes a new instance of the class. /// @@ -25,6 +30,7 @@ public Base64StringType( { Description = description; Pattern = @"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$"; + SpecifiedBy = new Uri(SpecifiedByUri); } /// @@ -32,7 +38,10 @@ public Base64StringType( /// [ActivatorUtilitiesConstructor] public Base64StringType() - : this(ScalarNames.Base64String, bind: BindingBehavior.Implicit) + : this( + ScalarNames.Base64String, + TypeResources.Base64StringType_Description, + BindingBehavior.Implicit) { } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/ByteType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/ByteType.cs index 8bd6755f875..96228726389 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/ByteType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/ByteType.cs @@ -6,11 +6,15 @@ namespace HotChocolate.Types; /// -/// The Byte scalar type represents a signed numeric non‐fractional -/// value greater than or equal to -128 and smaller than or equal to 127. +/// The Byte scalar type represents a signed 8-bit integer. It is intended for scenarios +/// where values are constrained to the range -128 to 127, such as representing small offsets, +/// temperature differences, or compact signed counters. /// +/// Specification public class ByteType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/byte.html"; + /// /// Initializes a new instance of the class. /// @@ -21,6 +25,7 @@ public ByteType( : base(name, sbyte.MinValue, sbyte.MaxValue, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs index 610b65cd732..b92aeda462c 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs @@ -10,26 +10,17 @@ namespace HotChocolate.Types; /// -/// -/// This scalar represents an exact point in time. This point in time is specified by having an -/// offset to UTC and does not use a time zone. -/// -/// -/// It is a slightly refined version of -/// RFC 3339, including the -/// errata. -/// +/// The DateTime scalar type represents a date and time with time zone offset information. It +/// is intended for scenarios where representing a specific instant in time is required, such as +/// recording when an event occurred, scheduling future events across time zones, or storing +/// timestamps for auditing purposes. /// -/// Specification -public class DateTimeType : ScalarType +/// Specification +public partial class DateTimeType : ScalarType { - private const string UtcFormat = "yyyy-MM-ddTHH\\:mm\\:ss.fffZ"; - private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.fffzzz"; - private const string SpecifiedByUri = "https://scalars.graphql.org/andimarek/date-time.html"; - - private static readonly Regex s_dateTimeScalarRegex = new( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?(Z|[+-][0-9]{2}:[0-9]{2})$", - RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled); + private const string UtcFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFFZ"; + private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFFzzz"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/date-time.html"; private readonly bool _enforceSpecFormat; @@ -44,7 +35,7 @@ public DateTimeType( : base(name, bind) { Description = description; - Pattern = @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,7})?(?:[Zz]|[+-]\d{2}:\d{2})$"; + Pattern = @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:[Zz]|[+-]\d{2}:\d{2})$"; SpecifiedBy = new Uri(SpecifiedByUri); _enforceSpecFormat = !disableFormatCheck; } @@ -118,30 +109,31 @@ protected override StringValueNode OnValueToLiteral(DateTimeOffset runtimeValue) } } - private bool TryParseStringValue(string serialized, out DateTimeOffset runtimeValue) + private bool TryParseStringValue(string serialized, out DateTimeOffset value) { // Check format. - if (_enforceSpecFormat && !s_dateTimeScalarRegex.IsMatch(serialized)) - { - runtimeValue = default; - return false; - } - - // No "Unknown Local Offset Convention". - // https://scalars.graphql.org/andimarek/date-time.html#sec-Overview.No-Unknown-Local-Offset-Convention- - if (serialized.EndsWith("-00:00")) + if (_enforceSpecFormat && !DateTimeRegex().IsMatch(serialized)) { - runtimeValue = default; + value = default; return false; } - if (DateTimeOffset.TryParse(serialized, CultureInfo.InvariantCulture, DateTimeStyles.None, out var dt)) + if (DateTimeOffset.TryParse( + serialized, + CultureInfo.InvariantCulture, + DateTimeStyles.None, + out var dt)) { - runtimeValue = dt; + value = dt; return true; } - runtimeValue = default; + value = default; return false; } + + [GeneratedRegex( + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] + private static partial Regex DateTimeRegex(); } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/DateType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/DateType.cs index 6e36ac252bd..a7a4f6ef880 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/DateType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/DateType.cs @@ -9,9 +9,16 @@ namespace HotChocolate.Types; +/// +/// The Date scalar type represents a date in UTC. Unlike LocalDate, which represents +/// a calendar date with local context (such as where a contract was signed), Date always +/// represents the UTC date without any local context. +/// +/// Specification public class DateType : ScalarType { private const string DateFormat = "yyyy-MM-dd"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/date.html"; private readonly bool _enforceSpecFormat; /// @@ -26,6 +33,7 @@ public DateType( { Description = description; Pattern = @"^\d{4}-\d{2}-\d{2}$"; + SpecifiedBy = new Uri(SpecifiedByUri); _enforceSpecFormat = !disableFormatCheck; } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/DecimalType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/DecimalType.cs index 50b0ed1f704..31fa76ff4d3 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/DecimalType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/DecimalType.cs @@ -6,12 +6,16 @@ namespace HotChocolate.Types; /// -/// Represents a scalar type for high-precision decimal numbers in GraphQL. -/// This type serializes as a floating-point number and is suitable for financial calculations -/// where precision is critical. +/// The Decimal scalar type represents a decimal floating-point number with high precision. +/// It is intended for scenarios where precise decimal representation is critical, such as financial +/// calculations, monetary values, scientific measurements, or any domain where floating-point +/// rounding errors are unacceptable. /// +/// Specification public class DecimalType : FloatTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/decimal.html"; + /// /// Initializes a new instance of the class. /// @@ -37,6 +41,7 @@ public DecimalType( : base(name, min, max, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs index 77a9a6e102b..49d0dfaa1b8 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Text.Json; +using System.Text.RegularExpressions; using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.Properties; @@ -9,12 +10,19 @@ namespace HotChocolate.Types; /// -/// The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) -/// with the format `YYYY-MM-DDThh:mm:ss`. +/// The LocalDateTime scalar type represents a date and time without time zone information. +/// It is intended for scenarios where time zone context is either unnecessary or managed +/// separately, such as recording birthdates and times (where the event occurred in a specific local +/// context), displaying timestamps in a user's local time zone (where the time zone is known from +/// context), or recording historical timestamps where the time zone was not captured. /// -public class LocalDateTimeType : ScalarType +/// Specification +public partial class LocalDateTimeType : ScalarType { - private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss"; + private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFF"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/local-date-time.html"; + + private readonly bool _enforceSpecFormat; /// /// Initializes a new instance of the class. @@ -22,11 +30,26 @@ public class LocalDateTimeType : ScalarType public LocalDateTimeType( string name, string? description = null, - BindingBehavior bind = BindingBehavior.Explicit) + BindingBehavior bind = BindingBehavior.Explicit, + bool disableFormatCheck = false) : base(name, bind) { Description = description; - Pattern = @"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$"; + Pattern = @"^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$"; + SpecifiedBy = new Uri(SpecifiedByUri); + _enforceSpecFormat = !disableFormatCheck; + } + + /// + /// Initializes a new instance of the class. + /// + public LocalDateTimeType(bool disableFormatCheck) + : this( + ScalarNames.LocalDateTime, + TypeResources.LocalDateTimeType_Description, + BindingBehavior.Implicit, + disableFormatCheck: disableFormatCheck) + { } /// @@ -70,11 +93,17 @@ protected override void OnCoerceOutputValue(DateTime runtimeValue, ResultElement protected override StringValueNode OnValueToLiteral(DateTime runtimeValue) => new StringValueNode(runtimeValue.ToString(LocalFormat, CultureInfo.InvariantCulture)); - private static bool TryParseStringValue(string serialized, out DateTime value) + private bool TryParseStringValue(string serialized, out DateTime value) { - if (DateTime.TryParseExact( + // Check format. + if (_enforceSpecFormat && !LocalDateTimeRegex().IsMatch(serialized)) + { + value = default; + return false; + } + + if (DateTime.TryParse( serialized, - LocalFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out var dateTime)) @@ -86,4 +115,8 @@ private static bool TryParseStringValue(string serialized, out DateTime value) value = default; return false; } + + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", + RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] + private static partial Regex LocalDateTimeRegex(); } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateType.cs index 18eccccfdc2..54173c6fe64 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateType.cs @@ -9,19 +9,16 @@ namespace HotChocolate.Types; /// -/// -/// This scalar represents a date without a time-zone in the -/// ISO-8601 calendar system. -/// -/// -/// The pattern is "YYYY-MM-DD" with "YYYY" representing the year, "MM" the month, and "DD" the day. -/// +/// The LocalDate scalar type represents a date without time or time zone information. It is +/// intended for scenarios where only the calendar date matters in a local context, such as contract +/// effective dates, publication dates, or recurring events (e.g., "New Year's Day is January 1st"), +/// where the specific time of day and time zone are irrelevant or managed separately. /// -/// Specification +/// Specification public class LocalDateType : ScalarType { private const string LocalFormat = "yyyy-MM-dd"; - private const string SpecifiedByUri = "https://scalars.graphql.org/andimarek/local-date.html"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/local-date.html"; private readonly bool _enforceSpecFormat; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs index 87b092ad3eb..b7e709dbc34 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Text.Json; +using System.Text.RegularExpressions; using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.Properties; @@ -9,12 +10,17 @@ namespace HotChocolate.Types; /// -/// The `LocalTime` scalar type is a local time string (i.e., with no associated timezone) -/// in 24-hr HH:mm:ss. +/// The LocalTime scalar type represents a time of day without date or time zone information. +/// It is intended for scenarios where only the time component matters, such as business operating +/// hours (e.g., "opens at 09:00"), daily schedules, or recurring time-based events where the +/// specific date is irrelevant. /// -public class LocalTimeType : ScalarType +/// Specification +public partial class LocalTimeType : ScalarType { - private const string LocalFormat = "HH:mm:ss"; + private const string LocalFormat = "HH:mm:ss.FFFFFFF"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/local-time.html"; + private readonly bool _enforceSpecFormat; /// @@ -28,7 +34,8 @@ public LocalTimeType( : base(name, bind) { Description = description; - Pattern = @"^\d{2}:\d{2}:\d{2}$"; + Pattern = @"^\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$"; + SpecifiedBy = new Uri(SpecifiedByUri); _enforceSpecFormat = !disableFormatCheck; } @@ -87,20 +94,14 @@ protected override StringValueNode OnValueToLiteral(TimeOnly runtimeValue) private bool TryParseStringValue(string serialized, out TimeOnly value) { - if (_enforceSpecFormat) + // Check format. + if (_enforceSpecFormat && !LocalTimeRegex().IsMatch(serialized)) { - if (TimeOnly.TryParseExact( - serialized, - LocalFormat, - CultureInfo.InvariantCulture, - DateTimeStyles.None, - out var time)) - { - value = time; - return true; - } + value = default; + return false; } - else if (TimeOnly.TryParse( + + if (TimeOnly.TryParse( serialized, CultureInfo.InvariantCulture, out var time)) @@ -112,4 +113,7 @@ private bool TryParseStringValue(string serialized, out TimeOnly value) value = default; return false; } + + [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", RegexOptions.ExplicitCapture)] + private static partial Regex LocalTimeRegex(); } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LongType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LongType.cs index d84b257e345..a2f90c97caf 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LongType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LongType.cs @@ -6,12 +6,16 @@ namespace HotChocolate.Types; /// -/// Represents a scalar type for 64-bit signed integers (long) in GraphQL. -/// This type serializes as an integer and supports values from -9,223,372,036,854,775,808 -/// to 9,223,372,036,854,775,807. +/// The Long scalar type represents a signed 64-bit integer. It is intended for scenarios +/// where values exceed the range of the built-in Int scalar, such as representing large +/// identifiers, timestamps in milliseconds, file sizes in bytes, or any integer values requiring +/// more than 32 bits. /// +/// Specification public class LongType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/long.html"; + /// /// Initializes a new instance of the class. /// @@ -37,6 +41,7 @@ public LongType( : base(name, min, max, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/ShortType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/ShortType.cs index 7f995ddaeb8..ae3b550df29 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/ShortType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/ShortType.cs @@ -6,11 +6,15 @@ namespace HotChocolate.Types; /// -/// Represents a scalar type for 16-bit signed integers (short) in GraphQL. -/// This type serializes as an integer and supports values from -32,768 to 32,767. +/// The Short scalar type represents a signed 16-bit integer. It is intended for scenarios +/// where values are constrained to the range -32,768 to 32,767, providing a more compact +/// representation than the built-in Int scalar for smaller integer values. /// +/// Specification public class ShortType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/short.html"; + /// /// Initializes a new instance of the class. /// @@ -36,6 +40,7 @@ public ShortType( : base(name, min, max, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/TimeSpanType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/TimeSpanType.cs index d011dcf9ffb..5815fdc8508 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/TimeSpanType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/TimeSpanType.cs @@ -9,11 +9,15 @@ namespace HotChocolate.Types; /// -/// The TimeSpan scalar type represented in two formats: -/// and +/// The TimeSpan scalar type represents a duration of time. It is intended for scenarios +/// where you need to represent time intervals, such as elapsed time, timeout durations, scheduling +/// intervals, or any measurement of time that is not tied to a specific date or time. /// +/// Specification public class TimeSpanType : ScalarType { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/time-span.html"; + public TimeSpanFormat Format { get; } public TimeSpanType( @@ -40,6 +44,11 @@ public TimeSpanType( => @"^-?(?:(?:\d{1,8})\.)?(?:[0-1]?\d|2[0-3]):(?:[0-5]?\d):(?:[0-5]?\d)(?:\.(?:\d{1,7}))?$", _ => throw new ArgumentOutOfRangeException(nameof(format), format, null) }; + + if (format == TimeSpanFormat.Iso8601) + { + SpecifiedBy = new Uri(SpecifiedByUri); + } } [ActivatorUtilitiesConstructor] diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedByteType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedByteType.cs index 0f95f3703da..1c9f5861ff6 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedByteType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedByteType.cs @@ -6,11 +6,15 @@ namespace HotChocolate.Types; /// -/// Represents a scalar type for unsigned 8-bit integers (byte) in GraphQL. -/// This type serializes as an integer and supports values from 0 to 255. +/// The UnsignedByte scalar type represents an unsigned 8-bit integer. It is intended for +/// scenarios where values are constrained to the range 0 to 255, such as representing color channel +/// values (RGB), small counters, or byte-level data. /// +/// Specification public class UnsignedByteType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/unsigned-byte.html"; + /// /// Initializes a new instance of the class. /// @@ -36,6 +40,7 @@ public UnsignedByteType( : base(name, min, max, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedIntType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedIntType.cs index 8a9213b1401..33430327e9f 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedIntType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedIntType.cs @@ -6,11 +6,15 @@ namespace HotChocolate.Types; /// -/// The UnsignedInt scalar type represents an unsigned 32‐bit numeric non‐fractional -/// value greater than or equal to 0. +/// The UnsignedInt scalar type represents an unsigned 32-bit integer. It is intended for +/// scenarios where values are constrained to the range 0 to 4,294,967,295, such as representing +/// counts, sizes, indices, or other non-negative integer values. /// +/// Specification public class UnsignedIntType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/unsigned-int.html"; + /// /// Initializes a new instance of the class. /// @@ -21,6 +25,7 @@ public UnsignedIntType( : base(name, uint.MinValue, uint.MaxValue, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedLongType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedLongType.cs index f1de154fdc3..0e2f4e196b9 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedLongType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedLongType.cs @@ -6,11 +6,16 @@ namespace HotChocolate.Types; /// -/// The `UnsignedLong` scalar type represents a signed 64‐bit numeric non‐fractional -/// value greater than or equal to 0. +/// The UnsignedLong scalar type represents an unsigned 64-bit integer. It is intended for +/// scenarios where values exceed the range of unsigned 32-bit integers, such as representing very +/// large counts, file sizes, memory addresses, or any non-negative integer values requiring more +/// than 32 bits. /// +/// Specification public class UnsignedLongType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/unsigned-long.html"; + /// /// Initializes a new instance of the class. /// @@ -21,6 +26,7 @@ public UnsignedLongType( : base(name, ulong.MinValue, ulong.MaxValue, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedShortType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedShortType.cs index 017ccee408d..c55527f9fc9 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedShortType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UnsignedShortType.cs @@ -6,11 +6,15 @@ namespace HotChocolate.Types; /// -/// The UnsignedShortType scalar type represents an unsigned numeric non‐fractional -/// value greater than or equal to 0 and smaller or equal to 65535. +/// The UnsignedShort scalar type represents an unsigned 16-bit integer. It is intended for +/// scenarios where values are constrained to the range 0 to 65,535, such as representing port +/// numbers, small counts, or other non-negative values that fit within 16 bits. /// +/// Specification public class UnsignedShortType : IntegerTypeBase { + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/unsigned-short.html"; + /// /// Initializes a new instance of the class. /// @@ -21,6 +25,7 @@ public UnsignedShortType( : base(name, ushort.MinValue, ushort.MaxValue, bind) { Description = description; + SpecifiedBy = new Uri(SpecifiedByUri); } /// diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UriType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UriType.cs index ca862ff7f92..e501402124e 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UriType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UriType.cs @@ -1,18 +1,22 @@ using System.Text.Json; using HotChocolate.Features; using HotChocolate.Language; +using HotChocolate.Properties; using HotChocolate.Text.Json; using static HotChocolate.Utilities.ThrowHelper; namespace HotChocolate.Types; /// -/// The URI scalar type represents a valid URI as defined by RFC 3986. -/// The scalar serializes as a string. +/// The URI scalar type represents a Uniform Resource Identifier (URI) as defined by RFC +/// 3986. It is intended for scenarios where a field must contain a valid URI, which includes both +/// URLs (locators) and URNs (names), such as resource identifiers, namespace identifiers, or any +/// standardized resource reference. /// +/// Specification public class UriType : ScalarType { - private const string SpecifiedByUri = "https://tools.ietf.org/html/rfc3986"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/uri.html"; /// /// Initializes a new instance of the class. @@ -32,7 +36,10 @@ public UriType( /// [ActivatorUtilitiesConstructor] public UriType() - : this(ScalarNames.URI, bind: BindingBehavior.Implicit) + : this( + ScalarNames.URI, + TypeResources.UriType_Description, + BindingBehavior.Implicit) { } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UrlType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UrlType.cs index c843a107872..4ef4ebcd271 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UrlType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UrlType.cs @@ -1,18 +1,21 @@ using System.Text.Json; using HotChocolate.Features; using HotChocolate.Language; +using HotChocolate.Properties; using HotChocolate.Text.Json; using static HotChocolate.Utilities.ThrowHelper; namespace HotChocolate.Types; /// -/// The URL scalar type represents a valid URL as defined by RFC 3986. -/// The scalar serializes as a string. +/// The URL scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986. +/// It is intended for scenarios where a field must contain a valid URL, such as links to external +/// resources, API endpoints, image sources, or any web-accessible resource. /// +/// Specification public class UrlType : ScalarType { - private const string SpecifiedByUri = "https://tools.ietf.org/html/rfc3986"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/url.html"; // TODO: This is for backwards compatibility. The UriType should be used for relative URIs. private readonly bool _allowRelativeUris; @@ -34,7 +37,7 @@ public UrlType( /// /// Initializes a new instance of the class. /// - public UrlType(bool allowRelativeUris = false) : this(ScalarNames.URL) + public UrlType(bool allowRelativeUris = false) : this(ScalarNames.URL, TypeResources.UrlType_Description) { _allowRelativeUris = allowRelativeUris; } @@ -43,7 +46,7 @@ public UrlType(bool allowRelativeUris = false) : this(ScalarNames.URL) /// Initializes a new instance of the class. /// [ActivatorUtilitiesConstructor] - public UrlType() : this(ScalarNames.URL) + public UrlType() : this(ScalarNames.URL, TypeResources.UrlType_Description) { } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/UuidType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/UuidType.cs index 346ddac3c7d..a9e853ef897 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/UuidType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/UuidType.cs @@ -11,12 +11,15 @@ namespace HotChocolate.Types; /// -/// The UUID scalar type represents a universally unique identifier (UUID) as defined by RFC 4122. -/// This type supports multiple GUID string formats (N, D, B, P) and serializes as a string. +/// The UUID scalar type represents a Universally Unique Identifier (UUID) as defined by RFC +/// 9562. It is intended for scenarios where globally unique identifiers are required, such as +/// database primary keys, distributed system identifiers, or any situation requiring +/// collision-resistant unique identifiers. /// +/// Specification public class UuidType : ScalarType { - private const string SpecifiedByUri = "https://tools.ietf.org/html/rfc4122"; + private const string SpecifiedByUri = "https://scalars.graphql.org/chillicream/uuid.html"; private readonly string _format; private readonly bool _enforceFormat; @@ -39,9 +42,10 @@ public class UuidType : ScalarType public UuidType(char defaultFormat = '\0', bool enforceFormat = false) : this( ScalarNames.UUID, - defaultFormat: defaultFormat, - enforceFormat: enforceFormat, - bind: BindingBehavior.Implicit) + TypeResources.UuidType_Description, + defaultFormat, + enforceFormat, + BindingBehavior.Implicit) { } diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap index 9c298108c8d..e44b69ab6d5 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap @@ -7028,7 +7028,7 @@ { "kind": "SCALAR", "name": "Any", - "description": null, + "description": "The `Any` scalar type represents any valid GraphQL value.", "fields": null, "inputFields": null, "interfaces": null, @@ -7277,6 +7277,29 @@ "onOperation": false, "onFragment": false, "onField": false + }, + { + "name": "specifiedBy", + "description": "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.", + "args": [ + { + "name": "url", + "description": "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "onOperation": false, + "onFragment": false, + "onField": false } ] } diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap index a85f6c5755b..724f01e9b20 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap @@ -112,4 +112,8 @@ enum Unit { METERS } -scalar Any +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsCoercedToTypesOtherThanTheDefinedClrTypes.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsCoercedToTypesOtherThanTheDefinedClrTypes.snap index c81d46d0d17..5e03c026cac 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsCoercedToTypesOtherThanTheDefinedClrTypes.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsCoercedToTypesOtherThanTheDefinedClrTypes.snap @@ -1,5 +1,5 @@ -{ +{ "data": { - "time": "2018-05-29T01:00:00.000Z" + "time": "2018-05-29T01:00:00Z" } } diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsNotSerializedAndMustBeConvertedToClrType.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsNotSerializedAndMustBeConvertedToClrType.snap index c20d46dde07..2fc222d87f3 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsNotSerializedAndMustBeConvertedToClrType.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsNotSerializedAndMustBeConvertedToClrType.snap @@ -1,5 +1,5 @@ -{ +{ "data": { - "time": "2018-01-01T12:10:10.000Z" + "time": "2018-01-01T12:10:10Z" } } diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsPartlyNotSerializedAndMustBeConvertedToClrType.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsPartlyNotSerializedAndMustBeConvertedToClrType.snap index 428ac07ab08..05e00523bfe 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsPartlyNotSerializedAndMustBeConvertedToClrType.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariableIsPartlyNotSerializedAndMustBeConvertedToClrType.snap @@ -1,8 +1,8 @@ -{ +{ "data": { "foo": { "id": "934b987bc0d842bbabfd8a3b3f8b476e", - "time": "2018-05-29T01:00:00.000Z", + "time": "2018-05-29T01:00:00Z", "number": 123 } } diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariablesAreCoercedToTypesOtherThanTheDefinedClrTypes.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariablesAreCoercedToTypesOtherThanTheDefinedClrTypes.snap index 428ac07ab08..05e00523bfe 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariablesAreCoercedToTypesOtherThanTheDefinedClrTypes.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/TypeConverter/__snapshots__/TypeConverterTests.VariablesAreCoercedToTypesOtherThanTheDefinedClrTypes.snap @@ -1,8 +1,8 @@ -{ +{ "data": { "foo": { "id": "934b987bc0d842bbabfd8a3b3f8b476e", - "time": "2018-05-29T01:00:00.000Z", + "time": "2018-05-29T01:00:00Z", "number": 123 } } diff --git a/src/HotChocolate/Core/test/Execution.Tests/__resources__/Crypto.graphql b/src/HotChocolate/Core/test/Execution.Tests/__resources__/Crypto.graphql index 2a7a5588193..b28c641369f 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/__resources__/Crypto.graphql +++ b/src/HotChocolate/Core/test/Execution.Tests/__resources__/Crypto.graphql @@ -13,6 +13,16 @@ directive @defer( if: Boolean ) on FRAGMENT_SPREAD | INLINE_FRAGMENT +""" +The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions. +""" +directive @specifiedBy( + """ + The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types. + """ + url: String! +) on SCALAR + """ The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`. """ @@ -350,9 +360,9 @@ type HistoryEdge { } """ -The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone. +The `DateTime` scalar type represents a date and time with time zone offset information. """ -scalar DateTime +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") """ A connection to a list of items. diff --git a/src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.Query_Specified_By.snap b/src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.Query_Specified_By.snap index fc5586394c7..b76a617bd81 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.Query_Specified_By.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.Query_Specified_By.snap @@ -1,7 +1,7 @@ { "data": { "__type": { - "specifiedByURL": "https://scalars.graphql.org/andimarek/date-time.html" + "specifiedByURL": "https://scalars.graphql.org/chillicream/date-time.html" } } } diff --git a/src/HotChocolate/Core/test/Types.Json.Tests/__snapshots__/FromJsonDirectiveTests.MapField_AutomaticScalars.snap b/src/HotChocolate/Core/test/Types.Json.Tests/__snapshots__/FromJsonDirectiveTests.MapField_AutomaticScalars.snap index 4a7231da2cd..5dbef908014 100644 --- a/src/HotChocolate/Core/test/Types.Json.Tests/__snapshots__/FromJsonDirectiveTests.MapField_AutomaticScalars.snap +++ b/src/HotChocolate/Core/test/Types.Json.Tests/__snapshots__/FromJsonDirectiveTests.MapField_AutomaticScalars.snap @@ -6,7 +6,7 @@ "byte": 1, "byteArray": "Zm9v", "date": "1979-12-20", - "dateTime": "1979-12-20T15:00:00.000Z", + "dateTime": "1979-12-20T15:00:00Z", "decimal": 3.4, "float": 1.2, "id": "id", diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Input_Ignored_Default_Value_Is_Respected.snap b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Input_Ignored_Default_Value_Is_Respected.snap index 66c46e37bad..2c6e08adf65 100644 --- a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Input_Ignored_Default_Value_Is_Respected.snap +++ b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Input_Ignored_Default_Value_Is_Respected.snap @@ -1,9 +1,9 @@ -{ +{ "data": { "foo": { "bar": 42, "baz": 84, - "qux": "0001-01-01T00:00:00.000Z", + "qux": "0001-01-01T00:00:00Z", "quux": [ 1 ] diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap index eb76e6398fa..aa2096f37a8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap @@ -10,5 +10,5 @@ type QueryWithDateTime { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap index 0c7e237b8d2..55497e180b0 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap @@ -48,8 +48,8 @@ type Query { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap index b722b48816b..7e59890ca60 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap @@ -21,7 +21,8 @@ type QueryTypeWithStruct { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap index 375952f05f4..53273913fe0 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap @@ -19,4 +19,5 @@ directive @_abc(arg: UUID) on QUERY | OBJECT "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/SpecifiedByDirectiveTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/SpecifiedByDirectiveTypeTests.cs index b4714e9e9fa..d2a7afd0053 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/SpecifiedByDirectiveTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/SpecifiedByDirectiveTypeTests.cs @@ -57,8 +57,8 @@ type Query1 { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR - "The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." - scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") + "The `DateTime` scalar type represents a date and time with time zone offset information." + scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") """) .UseField(next => next) .BuildSchemaAsync(); diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql index a160fc4fa8e..325e64e0703 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql @@ -9,5 +9,5 @@ type Query1 { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap index 9807321cd0c..7ee696a1dfb 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap @@ -64,4 +64,5 @@ input FooInput { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs index e995e31736d..e6a2e4f561a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs @@ -1452,7 +1452,11 @@ type QueryJsonElement { jsonFromString: Any! } - scalar Any + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") """); } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs index aa2a4f1c625..7083d427bfc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs @@ -158,7 +158,7 @@ public void CoerceOutputValue_Utc_DateTimeOffset() type.CoerceOutputValue(dateTime, resultValue); // assert - resultValue.MatchInlineSnapshot("\"2018-06-11T08:46:14.000Z\""); + resultValue.MatchInlineSnapshot("\"2018-06-11T08:46:14Z\""); } [Fact] @@ -177,7 +177,7 @@ public void CoerceOutputValue_DateTimeOffset() type.CoerceOutputValue(dateTime, resultValue); // assert - resultValue.MatchInlineSnapshot("\"2018-06-11T08:46:14.000+04:00\""); + resultValue.MatchInlineSnapshot("\"2018-06-11T08:46:14+04:00\""); } [Fact] @@ -204,7 +204,7 @@ public void ValueToLiteral_DateTimeOffset() var dateTime = new DateTimeOffset( new DateTime(2018, 6, 11, 8, 46, 14), new TimeSpan(4, 0, 0)); - const string expectedLiteralValue = "2018-06-11T08:46:14.000+04:00"; + const string expectedLiteralValue = "2018-06-11T08:46:14+04:00"; // act var stringLiteral = (StringValueNode)type.ValueToLiteral(dateTime); @@ -220,7 +220,7 @@ public void ValueToLiteral_Utc_DateTimeOffset() var type = new DateTimeType(); DateTimeOffset dateTime = new DateTime(2018, 6, 11, 8, 46, 14, DateTimeKind.Utc); - const string expectedLiteralValue = "2018-06-11T08:46:14.000Z"; + const string expectedLiteralValue = "2018-06-11T08:46:14Z"; // act var stringLiteral = (StringValueNode)type.ValueToLiteral(dateTime); @@ -312,42 +312,14 @@ public static TheoryData ValidDateTimeScalarStrings() { return new TheoryData { - // https://scalars.graphql.org/andimarek/date-time.html#sec-Overview.Examples (valid examples) + // https://scalars.graphql.org/chillicream/date-time.html#sec-Input-spec.Examples (Valid input values) { - // A DateTime with UTC offset (+00:00). - "2011-08-30T13:22:53.108Z", - new(2011, 8, 30, 13, 22, 53, 108, TimeSpan.Zero) + "2023-12-24T15:30:00Z", + new DateTimeOffset(2023, 12, 24, 15, 30, 0, 0, TimeSpan.Zero) }, { - // A DateTime with +00:00 which is the same as UTC. - "2011-08-30T13:22:53.108+00:00", - new(2011, 8, 30, 13, 22, 53, 108, TimeSpan.Zero) - }, - { - // The z and t may be lower case. - "2011-08-30t13:22:53.108z", - new(2011, 8, 30, 13, 22, 53, 108, TimeSpan.Zero) - }, - { - // A DateTime with -3h offset. - "2011-08-30T13:22:53.108-03:00", - new(2011, 8, 30, 13, 22, 53, 108, new TimeSpan(-3, 0, 0)) - }, - { - // A DateTime with +3h 30min offset. - "2011-08-30T13:22:53.108+03:30", - new(2011, 8, 30, 13, 22, 53, 108, new TimeSpan(3, 30, 0)) - }, - // Additional test cases. - { - // A DateTime with 7 fractional digits. - "2011-08-30T13:22:53.1230000+03:30", - new(2011, 8, 30, 13, 22, 53, 123, new TimeSpan(3, 30, 0)) - }, - { - // A DateTime with no fractional seconds. - "2011-08-30T13:22:53+03:30", - new(2011, 8, 30, 13, 22, 53, 0, new TimeSpan(3, 30, 0)) + "2023-12-24T15:30:00.123456789+01:00", // Rounded to ".1234568". + new DateTimeOffset(2023, 12, 24, 15, 30, 0, 123, 456, TimeSpan.FromHours(1)).AddTicks(8) } }; } @@ -356,31 +328,24 @@ public static TheoryData InvalidDateTimeScalarStrings() { return [ - // https://scalars.graphql.org/andimarek/date-time.html#sec-Overview.Examples (invalid examples) - // The minutes of the offset are missing. - "2011-08-30T13:22:53.108-03", - // Too many digits for fractions of a second. Exactly three expected. - // -> We diverge from the specification here, and allow up to 7 fractional digits. - // Fractions of a second are missing. - // -> We diverge from the specification here, and do not require fractional seconds. - // No offset provided. - "2011-08-30T13:22:53.108", - // No time provided. - "2011-08-30", - // Negative offset (-00:00) is not allowed. - "2011-08-30T13:22:53.108-00:00", - // Seconds are not allowed for the offset. - "2011-08-30T13:22:53.108+03:30:15", - // 24 is not allowed as hour of the time. - "2011-08-30T24:22:53.108Z", + // https://scalars.graphql.org/chillicream/date-time.html#sec-Input-spec.Examples (Invalid input values) + // Missing time zone offset. + "2023-12-24T15:30:00", + // Space instead of T or t separator. + "2023-12-24 15:30:00Z", + // Invalid hour (25). + "2023-12-24T25:00:00Z", + // Invalid minute (60). + "2023-12-24T15:60:00Z", // ReSharper disable once GrammarMistakeInComment - // 30th of February is not a valid date. - "2010-02-30T21:22:53.108Z", - // 25 is not a valid hour for offset. - "2010-02-11T21:22:53.108+25:11", - // Additional test cases. - // A DateTime with 8 fractional digits. - "2011-08-30T13:22:53.12345678+03:30" + // Invalid date (February 30th). + "2023-02-30T15:30:00Z", + // More than 9 fractional second digits. + "2023-12-24T15:30:00.1234567890Z", + // Invalid offset (exceeds maximum). + "2023-12-24T15:30:00+25:00", + // Invalid offset format. + "2023-12-24T15:30:00 UTC" ]; } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs index 43f9ed268e2..1ef00a51716 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs @@ -36,6 +36,38 @@ public void CoerceInputLiteral() Assert.Equal(expectedDateTime, dateTime); } + [Theory] + [MemberData(nameof(ValidLocalDateTimeScalarStrings))] + public void CoerceInputLiteral_Valid(string dateTimeString, DateTime result) + { + // arrange + var type = new LocalDateTimeType(); + var literal = new StringValueNode(dateTimeString); + + // act + var dateTime = (DateTime?)type.CoerceInputLiteral(literal); + + // assert + Assert.Equal(result, dateTime); + } + + [Theory] + [MemberData(nameof(InvalidLocalDateTimeScalarStrings))] + public void CoerceInputLiteral_Invalid(string dateTime) + { + // arrange + var type = new LocalDateTimeType(); + var literal = new StringValueNode(dateTime); + + // act + void Action() => type.CoerceInputLiteral(literal); + + // assert + Assert.Equal( + "LocalDateTime cannot coerce the given literal of type `StringValue` to a runtime value.", + Assert.Throws(Action).Message); + } + [InlineData("en-US")] [InlineData("en-AU")] [InlineData("en-GB")] @@ -250,6 +282,21 @@ public async Task LocalDateTime_As_ReturnValue() .MatchSnapshotAsync(); } + [Fact] + public void LocalDateTime_Relaxed_Format_Check() + { + // arrange + const string s = "2011-08-30"; + + // act + var type = new LocalDateTimeType(disableFormatCheck: true); + var inputValue = JsonDocument.Parse($"\"{s}\"").RootElement; + var result = type.CoerceInputValue(inputValue, null!); + + // assert + Assert.IsType(result); + } + public class Query { [GraphQLType] @@ -280,4 +327,43 @@ public class Bar [GraphQLType] public DateTime GetLocalDateTime() => DateTime.MaxValue; } + + public static TheoryData ValidLocalDateTimeScalarStrings() + { + return new TheoryData + { + // https://scalars.graphql.org/chillicream/local-date-time.html#sec-Input-spec.Examples (Valid input values) + { + "2023-12-24T15:30:00", + new DateTime(2023, 12, 24, 15, 30, 0, 0) + }, + { + "2023-12-24t15:30:00.123456789", // Rounded to ".1234568". + new DateTime(2023, 12, 24, 15, 30, 0, 123, 456).AddTicks(8) + } + }; + } + + public static TheoryData InvalidLocalDateTimeScalarStrings() + { + return + [ + // https://scalars.graphql.org/chillicream/local-date-time.html#sec-Input-spec.Examples (Invalid input values) + // Contains time zone indicator Z. + "2023-12-24T15:30:00Z", + // Contains time zone offset. + "2023-12-24T15:30:00+05:30", + // Invalid separator (space instead of T or t). + "2023-12-24 15:30:00", + // Invalid hour (25). + "2023-12-24T25:00:00", + // Invalid minute (60). + "2023-12-24T15:60:00", + // ReSharper disable once GrammarMistakeInComment + // Invalid date (February 30th). + "2023-02-30T15:30:00", + // More than 9 fractional second digits. + "2023-12-24T15:30:00.1234567890" + ]; + } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTypeTests.cs index 1b7bdb3b4c2..7a839915e89 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTypeTests.cs @@ -300,14 +300,10 @@ public static TheoryData ValidLocalDateScalarStrings() { return new TheoryData { - // https://scalars.graphql.org/andimarek/local-date.html#sec-Overview + // https://scalars.graphql.org/chillicream/local-date.html#sec-Input-spec.Examples (Valid input values) { - "1983-10-20", - new(1983, 10, 20) - }, - { - "2023-04-01", - new(2023, 4, 1) + "2000-12-24", + new DateOnly(2000, 12, 24) } }; } @@ -316,9 +312,20 @@ public static TheoryData InvalidLocalDateScalarStrings() { return [ - // https://scalars.graphql.org/andimarek/local-date.html#sec-Overview - // There isn't a 13th month in a year. - "2011-13-10" + // https://scalars.graphql.org/chillicream/local-date.html#sec-Input-spec.Examples (Invalid input values) + // Contains time component. + "2023-12-24T15:30:00", + // Invalid month (13). + "2023-13-01", + // Invalid day (32). + "2023-12-32", + // Month and day must be zero-padded. + "2023-2-5", + // Invalid separator. + "2023/12/24", + // ReSharper disable once GrammarMistakeInComment + // Invalid date (February 30th). + "2023-02-30" ]; } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalTimeTypeTests.cs index e248cc59d5c..0b7cb3b3ab9 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalTimeTypeTests.cs @@ -36,6 +36,38 @@ public void CoerceInputLiteral() Assert.Equal(expectedTimeOnly, timeOnly); } + [Theory] + [MemberData(nameof(ValidLocalTimeScalarStrings))] + public void CoerceInputLiteral_Valid(string time, TimeOnly result) + { + // arrange + var type = new LocalTimeType(); + var literal = new StringValueNode(time); + + // act + var timeOnly = (TimeOnly?)type.CoerceInputLiteral(literal); + + // assert + Assert.Equal(result, timeOnly); + } + + [Theory] + [MemberData(nameof(InvalidLocalTimeScalarStrings))] + public void CoerceInputLiteral_Invalid(string time) + { + // arrange + var type = new LocalTimeType(); + var literal = new StringValueNode(time); + + // act + void Action() => type.CoerceInputLiteral(literal); + + // assert + Assert.Equal( + "LocalTime cannot coerce the given literal of type `StringValue` to a runtime value.", + Assert.Throws(Action).Message); + } + [InlineData("en-US")] [InlineData("en-AU")] [InlineData("en-GB")] @@ -250,6 +282,21 @@ public async Task TimeOnly_As_ReturnValue() .MatchSnapshotAsync(); } + [Fact] + public void LocalTime_Relaxed_Format_Check() + { + // arrange + const string s = "15:30"; + + // act + var type = new LocalTimeType(disableFormatCheck: true); + var inputValue = JsonDocument.Parse($"\"{s}\"").RootElement; + var result = type.CoerceInputValue(inputValue, null!); + + // assert + Assert.IsType(result); + } + public class Query { [GraphQLType(typeof(LocalTimeType))] @@ -277,4 +324,42 @@ public class Bar { public TimeOnly GetTime() => TimeOnly.MaxValue; } + + public static TheoryData ValidLocalTimeScalarStrings() + { + return new TheoryData + { + // https://scalars.graphql.org/chillicream/local-time.html#sec-Input-spec.Examples (Valid input values) + { + "09:00:00", + new TimeOnly(9, 0, 0) + }, + { + "07:30:00.500", + new TimeOnly(7, 30, 0, 500) + } + }; + } + + public static TheoryData InvalidLocalTimeScalarStrings() + { + return + [ + // https://scalars.graphql.org/chillicream/local-time.html#sec-Input-spec.Examples (Invalid input values) + // Contains time zone indicator Z. + "15:30:00Z", + // Contains time zone offset. + "15:30:00+05:30", + // Contains date component. + "2023-12-24T15:30:00", + // Missing seconds component. + "15:30", + // Invalid hour (24). + "24:00:00", + // Invalid minute (60). + "15:60:00", + // More than 9 fractional second digits. + "15:30:00.1234567890" + ]; + } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTimeTypeTests.Integration_DefaultDateTime.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTimeTypeTests.Integration_DefaultDateTime.snap index c7e847b7dda..aa8c161a1b8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTimeTypeTests.Integration_DefaultDateTime.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTimeTypeTests.Integration_DefaultDateTime.snap @@ -1,5 +1,5 @@ { "data": { - "test": "0001-01-01T00:00:00.000Z" + "test": "0001-01-01T00:00:00Z" } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap index 4b665f784b0..30cbe0b32fa 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap @@ -10,5 +10,8 @@ type QueryDate1 { foo: Foo! } -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap index 46ae77f57c6..a0e036bd588 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap @@ -10,5 +10,8 @@ type QueryDate2 { bar: Bar! } -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap index 73b3232e2f7..cbb93e6d505 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap @@ -10,5 +10,8 @@ type QueryDateTime1 { foo: Foo! } -"The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." -scalar LocalDateTime +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `LocalDateTime` scalar type represents a date and time without time zone information." +scalar LocalDateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue.snap index 9bee239ca23..3ad7f34982f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue.snap @@ -1,7 +1,7 @@ { "data": { "bar": { - "localDateTime": "9999-12-31T23:59:59" + "localDateTime": "9999-12-31T23:59:59.9999999" } } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap index 955dd9f8a76..64312f1b560 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap @@ -10,5 +10,8 @@ type QueryDateTime2 { bar: Bar! } -"The `LocalDateTime` scalar type is a local date/time string (i.e., with no associated timezone) with the format `YYYY-MM-DDThh:mm:ss`." -scalar LocalDateTime +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `LocalDateTime` scalar type represents a date and time without time zone information." +scalar LocalDateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap index 58a106f30aa..c38b86bcc30 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap @@ -13,5 +13,5 @@ type QueryDateTime1 { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." -scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/andimarek/local-date.html") +"The `LocalDate` scalar type represents a date without time or time zone information." +scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap index 9c425876836..c591f35a8dc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap @@ -13,5 +13,5 @@ type QueryDateTime2 { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." -scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/andimarek/local-date.html") +"The `LocalDate` scalar type represents a date without time or time zone information." +scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap index 65d1726247f..3e9463f3777 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap @@ -10,5 +10,8 @@ type QueryDateTime1 { foo: Foo! } -"The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." -scalar LocalTime +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `LocalTime` scalar type represents a time of day without date or time zone information." +scalar LocalTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue.snap index b5a3efa6587..652eda72d3d 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue.snap @@ -1,7 +1,7 @@ { "data": { "bar": { - "time": "23:59:59" + "time": "23:59:59.9999999" } } } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap index 00a7eb10eaa..69d0574921a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap @@ -10,5 +10,8 @@ type QueryDateTime2 { bar: Bar! } -"The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." -scalar LocalTime +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `LocalTime` scalar type represents a time of day without date or time zone information." +scalar LocalTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/TimeSpanTypeTests.PureCodeFirst_AutomaticallyBinds_TimeSpan.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/TimeSpanTypeTests.PureCodeFirst_AutomaticallyBinds_TimeSpan.snap index 38ef7160d11..084060d6f99 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/TimeSpanTypeTests.PureCodeFirst_AutomaticallyBinds_TimeSpan.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/TimeSpanTypeTests.PureCodeFirst_AutomaticallyBinds_TimeSpan.snap @@ -1,4 +1,4 @@ -schema { +schema { query: Query } @@ -6,5 +6,8 @@ type Query { duration: TimeSpan! } -"The `TimeSpan` scalar represents an ISO-8601 compliant duration type." -scalar TimeSpan +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `TimeSpan` scalar type represents a duration of time." +scalar TimeSpan @specifiedBy(url: "https://scalars.graphql.org/chillicream/time-span.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap index e582c172ff7..bfd4dc490ad 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap @@ -14,8 +14,8 @@ type QueryWithDateTime { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql index 81a97c2714e..e3ff6cb6662 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql @@ -27,5 +27,8 @@ input ShortOperationFilterInput { nlte: Short } -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql index 6e75c5b4bd5..821a6bdf563 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql @@ -27,5 +27,8 @@ input ShortOperationFilterInput { nlte: Short } -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql index 9a81edcf182..0ae937d2a0c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql @@ -332,22 +332,23 @@ enum FooBar { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." -scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/andimarek/local-date.html") +"The `LocalDate` scalar type represents a date without time or time zone information." +scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date.html") -"The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." -scalar LocalTime +"The `LocalTime` scalar type represents a time of day without date or time zone information." +scalar LocalTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-time.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -scalar URI @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") +"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." +scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") -"The UnsignedByte scalar type represents an unsigned 8-bit numeric non-fractional value greater than or equal to 0." -scalar UnsignedByte +"The `UnsignedByte` scalar type represents an unsigned 8-bit integer." +scalar UnsignedByte @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql index 0a5410ce3e3..5323083b9db 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql @@ -182,22 +182,23 @@ enum FooBar { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"The `LocalDate` scalar represents a date without a time-zone in the ISO-8601 calendar system." -scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/andimarek/local-date.html") +"The `LocalDate` scalar type represents a date without time or time zone information." +scalar LocalDate @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date.html") -"The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss." -scalar LocalTime +"The `LocalTime` scalar type represents a time of day without date or time zone information." +scalar LocalTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-time.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -scalar URI @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") +"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." +scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") -"The UnsignedByte scalar type represents an unsigned 8-bit numeric non-fractional value greater than or equal to 0." -scalar UnsignedByte +"The `UnsignedByte` scalar type represents an unsigned 8-bit integer." +scalar UnsignedByte @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql index 7b2cb5af737..ac76fa87083 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql @@ -205,11 +205,14 @@ enum FooBar { BAR } -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql index 4e6270d698e..bdde01c3f7a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql @@ -40,5 +40,8 @@ input ShortOperationFilterInput { nlte: Short } -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql index 3757da4121b..c6814833452 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql @@ -34,5 +34,8 @@ input ShortOperationFilterInput { nlte: Short } -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql index aa2819bd2bc..29da230f78a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql @@ -32,5 +32,8 @@ input LongOperationFilterInput { nlte: Long } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql index 73bff6bb44f..cd1ddb3e4a6 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql @@ -65,5 +65,8 @@ input StringOperationFilterInput { nendsWith: String } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql index ea8e4a2cf72..8dda7bc419f 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql @@ -281,7 +281,7 @@ type User @internal { id: ID! name: String! } - + directive @internal on OBJECT | FIELD_DEFINITION """ directive @internal on OBJECT | FIELD_DEFINITION @@ -302,11 +302,11 @@ directive @serializeAs("The primitive type a scalar is serialized to." type: [Sc By default, only a single source schema is allowed to contribute a particular field to an object type. - + This prevents source schemas from inadvertently defining similarly named fields that are not semantically equivalent. - + Fields must be explicitly marked as @shareable to allow multiple source schemas to define them, ensuring that the decision to serve a field from more than one source schema is intentional and coordinated. @@ -316,5 +316,8 @@ directive @shareable repeatable on OBJECT | FIELD_DEFINITION """ directive @shareable repeatable on OBJECT | FIELD_DEFINITION -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal @serializeAs(type: FLOAT) +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @serializeAs(type: FLOAT) @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql index 018c0a75bfd..60c7e4f724b 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql @@ -20,5 +20,8 @@ enum SortEnumType { DESC } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml index abbe13df373..527e25f28d4 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml @@ -72,7 +72,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml index 66ca47aff42..3c651f2a54f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml @@ -53,7 +53,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml index d5af155a938..d8751ded756 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml @@ -60,7 +60,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml index 82d0d873d2c..0a66198079f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml @@ -54,7 +54,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml index 6c5e9e8fa45..3b990e5e159 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml @@ -47,7 +47,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml index b70e40173e9..264e7d79b4f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml @@ -49,7 +49,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml index 33e87901224..1b7e5f3ef7c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml @@ -59,7 +59,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml index 3f700a4a4eb..afa2db45a84 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml @@ -53,7 +53,11 @@ sourceSchemas: directive @serializeAs("The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String) on SCALAR - scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) + "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." + directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + + "The `Any` scalar type represents any valid GraphQL value." + scalar Any @serializeAs(type: [ STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST ]) @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: document: | diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbAggregateFluentTests.AggregateFluent_Serializer.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbAggregateFluentTests.AggregateFluent_Serializer.snap index 7ea79187bb5..f2aa7a0cfae 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbAggregateFluentTests.AggregateFluent_Serializer.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbAggregateFluentTests.AggregateFluent_Serializer.snap @@ -1,13 +1,13 @@ 2020-01-11 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-11T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-11T00:00:00Z" + } + ] + } } --------------- @@ -18,14 +18,14 @@ aggregate([{ "$match" : { "testName" : { "$eq" : "2020-01-11T00:00:00+00:00" } } 2020-01-12 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-12T00:00:00Z" + } + ] + } } --------------- diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbCollectionTests.Collection_Serializer.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbCollectionTests.Collection_Serializer.snap index c538898ee7c..6cc35bea21f 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbCollectionTests.Collection_Serializer.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbCollectionTests.Collection_Serializer.snap @@ -1,13 +1,13 @@ 2020-01-11 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-11T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-11T00:00:00Z" + } + ] + } } --------------- @@ -18,14 +18,14 @@ find({ "testName" : { "$eq" : "2020-01-11T00:00:00+00:00" } }) 2020-01-12 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-12T00:00:00Z" + } + ] + } } --------------- diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql index a9fe2a25ed9..30deda0da84 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql @@ -142,16 +142,17 @@ input FooFilterInput { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql index bc8bd78ed90..0ca3435bf5d 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql @@ -127,16 +127,17 @@ input UuidOperationFilterInput { "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -"The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1." -scalar Short +"The `Short` scalar type represents a signed 16-bit integer." +scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime.snap index 03648b1060b..c0327fca6a0 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime.snap @@ -4,7 +4,7 @@ "data": { "root": [ { - "barDateTime": "2000-01-12T00:00:00.000Z" + "barDateTime": "2000-01-12T00:00:00Z" } ] } @@ -22,7 +22,7 @@ find({ "BarDateTime" : { "$eq" : { "$date" : "2000-01-12T00:00:00Z" } } }) "data": { "root": [ { - "barDateTime": "2000-01-12T00:00:00.000Z" + "barDateTime": "2000-01-12T00:00:00Z" } ] } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime_Nullable.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime_Nullable.snap index 9cc210a004c..49cce89c4ae 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime_Nullable.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_ShortEqual_Expression_DateTime_Nullable.snap @@ -1,13 +1,13 @@ 12 Result: --------------- -{ - "data": { - "root": [ - { - "barDateTime": "2000-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "barDateTime": "2000-01-12T00:00:00Z" + } + ] + } } --------------- @@ -18,14 +18,14 @@ find({ "BarDateTime" : { "$eq" : { "$date" : "2000-01-12T00:00:00Z" } } }) 13 Result: --------------- -{ - "data": { - "root": [ - { - "barDateTime": "2000-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "barDateTime": "2000-01-12T00:00:00Z" + } + ] + } } --------------- @@ -36,14 +36,14 @@ find({ "BarDateTime" : { "$eq" : { "$date" : "2000-01-12T00:00:00Z" } } }) null Result: --------------- -{ - "data": { - "root": [ - { - "barDateTime": null - } - ] - } +{ + "data": { + "root": [ + { + "barDateTime": null + } + ] + } } --------------- diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap index 9a629229477..c54d586ad8f 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap @@ -1,13 +1,13 @@ 2020-01-11 Result: --------------- -{ - "data": { - "root": [ - { - "bar": "2020-01-11T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "bar": "2020-01-11T00:00:00Z" + } + ] + } } --------------- @@ -18,14 +18,14 @@ find({ "Bar" : { "$gt" : { "DateTime" : { "$date" : "2000-01-01T00:00:00Z" }, "T 2020-01-12 Result: --------------- -{ - "data": { - "root": [ - { - "bar": "2020-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "bar": "2020-01-12T00:00:00Z" + } + ] + } } --------------- diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_Serializer.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_Serializer.snap index c538898ee7c..6cc35bea21f 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_Serializer.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_Serializer.snap @@ -1,13 +1,13 @@ 2020-01-11 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-11T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-11T00:00:00Z" + } + ] + } } --------------- @@ -18,14 +18,14 @@ find({ "testName" : { "$eq" : "2020-01-11T00:00:00+00:00" } }) 2020-01-12 Result: --------------- -{ - "data": { - "root": [ - { - "baz": "2020-01-12T00:00:00.000Z" - } - ] - } +{ + "data": { + "root": [ + { + "baz": "2020-01-12T00:00:00Z" + } + ] + } } --------------- diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbAggregateFluentTests.Collection_Configuration.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbAggregateFluentTests.Collection_Configuration.snap index 0210282f29b..8309ebe9f94 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbAggregateFluentTests.Collection_Configuration.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbAggregateFluentTests.Collection_Configuration.snap @@ -4,10 +4,10 @@ ASC Result: "data": { "root": [ { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" }, { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" } ] } @@ -25,10 +25,10 @@ DESC Result: "data": { "root": [ { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" }, { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" } ] } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.Collection_Configuration.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.Collection_Configuration.snap index 47d0869ec2b..3974bc45dcf 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.Collection_Configuration.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.Collection_Configuration.snap @@ -4,10 +4,10 @@ ASC Result: "data": { "root": [ { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" }, { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" } ] } @@ -25,10 +25,10 @@ DESC Result: "data": { "root": [ { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" }, { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" } ] } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap index cc3aaeb845d..3e14e4820d2 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbFindFluentTests.FindFluent_CombineQuery.snap @@ -4,10 +4,10 @@ ASC Result: "data": { "root": [ { - "bar": "2020-01-11T00:00:00.000Z" + "bar": "2020-01-11T00:00:00Z" }, { - "bar": "2020-01-12T00:00:00.000Z" + "bar": "2020-01-12T00:00:00Z" } ] } @@ -25,10 +25,10 @@ DESC Result: "data": { "root": [ { - "bar": "2020-01-11T00:00:00.000Z" + "bar": "2020-01-11T00:00:00Z" }, { - "bar": "2020-01-12T00:00:00.000Z" + "bar": "2020-01-12T00:00:00Z" } ] } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbSortCollectionTests.Collection_Configuration.snap b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbSortCollectionTests.Collection_Configuration.snap index 47d0869ec2b..3974bc45dcf 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbSortCollectionTests.Collection_Configuration.snap +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/__snapshots__/MongoDbSortCollectionTests.Collection_Configuration.snap @@ -4,10 +4,10 @@ ASC Result: "data": { "root": [ { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" }, { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" } ] } @@ -25,10 +25,10 @@ DESC Result: "data": { "root": [ { - "baz": "2020-01-12T00:00:00.000Z" + "baz": "2020-01-12T00:00:00Z" }, { - "baz": "2020-01-11T00:00:00.000Z" + "baz": "2020-01-11T00:00:00Z" } ] } diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_AST.snap b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_AST.snap index 6339cddb5d6..f0e7e96b404 100644 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_AST.snap +++ b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_AST.snap @@ -114,9 +114,12 @@ type FriendsEdge { node: Character } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") directive @export(as: String) on FIELD +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + directive @tag(name: String!) repeatable on SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_SDL.snap b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_SDL.snap index 6339cddb5d6..f0e7e96b404 100644 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_SDL.snap +++ b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.Download_Schema_SDL.snap @@ -114,9 +114,12 @@ type FriendsEdge { node: Character } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") directive @export(as: String) on FIELD +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + directive @tag(name: String!) repeatable on SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer.snap b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer.snap index ef938b8b7c3..2ea10353ac2 100644 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer.snap +++ b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer.snap @@ -91,6 +91,7 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." scalar Any type Starship { @@ -119,7 +120,7 @@ type FriendsEdge { node: Character } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." +"The `Long` scalar type represents a signed 64-bit integer." scalar Long "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." diff --git a/src/Nitro/CommandLine/src/CommandLine/schema.graphql b/src/Nitro/CommandLine/src/CommandLine/schema.graphql index 90d78f377d9..c9271fb082e 100644 --- a/src/Nitro/CommandLine/src/CommandLine/schema.graphql +++ b/src/Nitro/CommandLine/src/CommandLine/schema.graphql @@ -4839,17 +4839,20 @@ directive @shareable on OBJECT | FIELD_DEFINITION "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") +"The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." +scalar URL @specifiedBy(url: "https://scalars.graphql.org/chillicream/url.html") -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") "The `Upload` scalar type represents a file upload." scalar Upload diff --git a/src/StrawberryShake/Client/src/Core/Serialization/DateTimeSerializer.cs b/src/StrawberryShake/Client/src/Core/Serialization/DateTimeSerializer.cs index 4b6594ebd8f..3cd196d8dad 100644 --- a/src/StrawberryShake/Client/src/Core/Serialization/DateTimeSerializer.cs +++ b/src/StrawberryShake/Client/src/Core/Serialization/DateTimeSerializer.cs @@ -8,8 +8,8 @@ namespace StrawberryShake.Serialization; /// public class DateTimeSerializer : ScalarSerializer { - private const string UtcFormat = "yyyy-MM-ddTHH\\:mm\\:ss.fffZ"; - private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.fffzzz"; + private const string UtcFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFFZ"; + private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFFzzz"; public DateTimeSerializer(string typeName = BuiltInScalarNames.DateTime) : base(typeName) diff --git a/src/StrawberryShake/Client/src/Core/Serialization/LocalDateTimeSerializer.cs b/src/StrawberryShake/Client/src/Core/Serialization/LocalDateTimeSerializer.cs index b14eee09c33..fdeaf1bd378 100644 --- a/src/StrawberryShake/Client/src/Core/Serialization/LocalDateTimeSerializer.cs +++ b/src/StrawberryShake/Client/src/Core/Serialization/LocalDateTimeSerializer.cs @@ -8,7 +8,7 @@ namespace StrawberryShake.Serialization; /// public class LocalDateTimeSerializer : ScalarSerializer { - private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss"; + private const string LocalFormat = "yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFF"; public LocalDateTimeSerializer(string typeName = BuiltInScalarNames.LocalDateTime) : base(typeName) @@ -37,9 +37,8 @@ private static bool TryDeserializeFromString( [NotNullWhen(true)] out DateTime? value) { if (serialized is not null - && DateTime.TryParseExact( + && DateTime.TryParse( serialized, - LocalFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out var dt)) diff --git a/src/StrawberryShake/Client/src/Core/Serialization/LocalTimeSerializer.cs b/src/StrawberryShake/Client/src/Core/Serialization/LocalTimeSerializer.cs index 58ba913ad8b..a317b88e806 100644 --- a/src/StrawberryShake/Client/src/Core/Serialization/LocalTimeSerializer.cs +++ b/src/StrawberryShake/Client/src/Core/Serialization/LocalTimeSerializer.cs @@ -8,7 +8,7 @@ namespace StrawberryShake.Serialization; /// public class LocalTimeSerializer : ScalarSerializer { - private const string LocalFormat = "HH:mm:ss"; + private const string LocalFormat = "HH:mm:ss.FFFFFFF"; public LocalTimeSerializer(string typeName = BuiltInScalarNames.LocalTime) : base(typeName) @@ -37,9 +37,8 @@ private static bool TryDeserializeFromString( [NotNullWhen(true)] out TimeOnly? value) { if (serialized is not null - && TimeOnly.TryParseExact( + && TimeOnly.TryParse( serialized, - LocalFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out var time)) diff --git a/src/StrawberryShake/Client/src/Core/ThrowHelper.cs b/src/StrawberryShake/Client/src/Core/ThrowHelper.cs index a24d0d411f2..c561151006b 100644 --- a/src/StrawberryShake/Client/src/Core/ThrowHelper.cs +++ b/src/StrawberryShake/Client/src/Core/ThrowHelper.cs @@ -18,8 +18,8 @@ internal static GraphQLClientException InputFormatter_InvalidType( internal static GraphQLClientException DateTimeSerializer_InvalidFormat( string serializedValue) => new(new ClientError( - "The serialized format for DateTime must be `yyyy-MM-ddTHH\\:mm\\:ss.fffzzz`. " - + "For more information read: `https://scalars.graphql.org/andimarek/date-time.html`.", + "The serialized format for DateTime must be `yyyy-MM-ddTHH\\:mm\\:ss.FFFFFFFzzz`. " + + "For more information read: `https://scalars.graphql.org/chillicream/date-time.html`.", extensions: new Dictionary { { "serializedValue", serializedValue } @@ -46,7 +46,7 @@ internal static GraphQLClientException LocalDateSerializer_InvalidFormat( internal static GraphQLClientException LocalDateTimeSerializer_InvalidFormat( string serializedValue) => new(new ClientError( - "The serialized format for LocalDateTime must be `yyyy-MM-ddTHH:mm:ss`.", + "The serialized format for LocalDateTime must be `yyyy-MM-ddTHH:mm:ss.FFFFFFF`.", extensions: new Dictionary { { "serializedValue", serializedValue } @@ -55,7 +55,7 @@ internal static GraphQLClientException LocalDateTimeSerializer_InvalidFormat( internal static GraphQLClientException LocalTimeSerializer_InvalidFormat( string serializedValue) => new(new ClientError( - "The serialized format for LocalTime must be `HH:mm:ss`.", + "The serialized format for LocalTime must be `HH:mm:ss.FFFFFFF`.", extensions: new Dictionary { { "serializedValue", serializedValue } diff --git a/src/StrawberryShake/Client/test/Core.Tests/Serialization/DateTimeSerializerTests.cs b/src/StrawberryShake/Client/test/Core.Tests/Serialization/DateTimeSerializerTests.cs index 8e9f44a28e9..b5b1aa9e203 100644 --- a/src/StrawberryShake/Client/test/Core.Tests/Serialization/DateTimeSerializerTests.cs +++ b/src/StrawberryShake/Client/test/Core.Tests/Serialization/DateTimeSerializerTests.cs @@ -10,7 +10,7 @@ public class DateTimeSerializerTests public void Parse() { // arrange - const string value = "2011-08-30T13:22:53.108Z"; + const string value = "2011-08-30T13:22:53.123456789Z"; // act var result = Serializer.Parse(value); @@ -41,13 +41,13 @@ public void Format_Null() public void Format_Value() { // arrange - var value = new DateTimeOffset(2011, 8, 30, 13, 22, 53, 108, TimeSpan.Zero); + var value = new DateTimeOffset(2011, 8, 30, 13, 22, 53, 123, 456, TimeSpan.Zero).AddTicks(7); // act var result = Serializer.Format(value); // assert - Assert.Equal("2011-08-30T13:22:53.108Z", result); + Assert.Equal("2011-08-30T13:22:53.1234567Z", result); } [Fact] diff --git a/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalDateTimeSerializerTests.cs b/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalDateTimeSerializerTests.cs index 46f2d4c085c..cfeccccdc53 100644 --- a/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalDateTimeSerializerTests.cs +++ b/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalDateTimeSerializerTests.cs @@ -24,6 +24,27 @@ public void Parse() Assert.Equal(53, result.Second); } + [Fact] + public void Parse_With_Fractional_Seconds() + { + // arrange + const string value = "2011-08-30T13:22:53.123456789"; + + // act + var result = Serializer.Parse(value); + + // assert + Assert.Equal(2011, result.Year); + Assert.Equal(8, result.Month); + Assert.Equal(30, result.Day); + Assert.Equal(13, result.Hour); + Assert.Equal(22, result.Minute); + Assert.Equal(53, result.Second); + Assert.Equal(123, result.Millisecond); + Assert.Equal(456, result.Microsecond); + Assert.Equal(800, result.Nanosecond); + } + [Fact] public void Format_Null() { @@ -40,7 +61,7 @@ public void Format_Null() public void Format_Value() { // arrange - var value = new DateTime(2011, 8, 30, 13, 22, 53, 108); + var value = new DateTime(2011, 8, 30, 13, 22, 53); // act var result = Serializer.Format(value); @@ -49,6 +70,19 @@ public void Format_Value() Assert.Equal("2011-08-30T13:22:53", result); } + [Fact] + public void Format_Value_With_Fractional_Seconds() + { + // arrange + var value = new DateTime(2011, 8, 30, 13, 22, 53, 123, 456).AddTicks(7); + + // act + var result = Serializer.Format(value); + + // assert + Assert.Equal("2011-08-30T13:22:53.1234567", result); + } + [Fact] public void Format_Exception() { diff --git a/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalTimeSerializerTests.cs b/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalTimeSerializerTests.cs index a1621dd9fd1..81c96bbfa3b 100644 --- a/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalTimeSerializerTests.cs +++ b/src/StrawberryShake/Client/test/Core.Tests/Serialization/LocalTimeSerializerTests.cs @@ -21,6 +21,24 @@ public void Parse() Assert.Equal(53, result.Second); } + [Fact] + public void Parse_With_Fractional_Seconds() + { + // arrange + const string value = "13:22:53.123456789"; + + // act + var result = Serializer.Parse(value); + + // assert + Assert.Equal(13, result.Hour); + Assert.Equal(22, result.Minute); + Assert.Equal(53, result.Second); + Assert.Equal(123, result.Millisecond); + Assert.Equal(456, result.Microsecond); + Assert.Equal(800, result.Nanosecond); + } + [Fact] public void Format_Null() { @@ -46,6 +64,19 @@ public void Format_Value() Assert.Equal("13:22:53", result); } + [Fact] + public void Format_Value_With_Fractional_Seconds() + { + // arrange + var value = new TimeOnly(13, 22, 53, 123, 456).Add(TimeSpan.FromTicks(7)); + + // act + var result = Serializer.Format(value); + + // assert + Assert.Equal("13:22:53.1234567", result); + } + [Fact] public void Format_Exception() { diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap index 8ff78c0829f..680c7f33291 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap @@ -2117,7 +2117,7 @@ { "Kind": "Scalar", "Name": "Any", - "Description": null, + "Description": "The `Any` scalar type represents any valid GraphQL value.", "Fields": null, "InputFields": null, "Interfaces": null, @@ -2536,6 +2536,29 @@ "OnOperation": false, "OnFragment": false, "OnField": false + }, + { + "Name": "specifiedBy", + "Description": "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.", + "Args": [ + { + "Name": "url", + "Description": "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.", + "Type": { + "Kind": "NonNull", + "Name": null, + "OfType": { + "Kind": "Scalar", + "Name": "String", + "OfType": null + } + }, + "DefaultValue": null + } + ], + "OnOperation": false, + "OnFragment": false, + "OnField": false } ] } @@ -6294,7 +6317,7 @@ "__typename": "__Type", "Name": "Any", "Kind": "Scalar", - "Description": null, + "Description": "The `Any` scalar type represents any valid GraphQL value.", "Fields": null, "InputFields": null, "Interfaces": null, @@ -7017,6 +7040,45 @@ "OnOperation": false, "OnFragment": false, "OnField": false + }, + { + "__typename": "__Directive", + "Name": "specifiedBy", + "Description": "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.", + "Args": [ + { + "__typename": "__InputValue", + "Name": "url", + "Description": "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.", + "Type": { + "__typename": "__Type", + "Name": null, + "Kind": "NonNull", + "Description": null, + "Fields": null, + "InputFields": null, + "Interfaces": null, + "EnumValues": null, + "PossibleTypes": null, + "OfType": { + "__typename": "__Type", + "Name": "String", + "Kind": "Scalar", + "Description": null, + "Fields": null, + "InputFields": null, + "Interfaces": null, + "EnumValues": null, + "PossibleTypes": null, + "OfType": null + } + }, + "DefaultValue": null + } + ], + "OnOperation": false, + "OnFragment": false, + "OnField": false } ] }, diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ActiveDirectory.Schema.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ActiveDirectory.Schema.graphql index 92d614d2e78..fabce8527a7 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ActiveDirectory.Schema.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ActiveDirectory.Schema.graphql @@ -258,8 +258,8 @@ type Person implements Node { "The first name of the person." firstName: String! id: ID! - "Url to image, you can specify a size in pixels by appending '?size=300' to get a square image." - image("The size in pixels of the image to return" size: Int): Url + "URL to image, you can specify a size in pixels by appending '?size=300' to get a square image." + image("The size in pixels of the image to return" size: Int): URL "Indicates if the person is active." isActive: Boolean! "Indicates if the person is a board member." @@ -1189,15 +1189,19 @@ input AdUserObjectSortInput { upn: SortEnumType } -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -scalar Url +"The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." +scalar URL @specifiedBy(url: "https://scalars.graphql.org/chillicream/url.html") directive @authorize("Defines when when the resolver shall be executed.By default the resolver is executed after the policy has determined that the current user is allowed to access the field." apply: ApplyPolicy! = BEFORE_RESOLVER "The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access the annotated resource." roles: [String!]) repeatable on SCHEMA | OBJECT | FIELD_DEFINITION + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ChatSchema.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ChatSchema.graphql index acd1423e97f..7ef9a119178 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ChatSchema.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/ChatSchema.graphql @@ -81,7 +81,7 @@ type Person { "Field id" id: ID! "Field imageUri" - imageUri: Url + imageUri: URL "Field isOnline" isOnline: Boolean! "Field lastSeen" @@ -300,7 +300,7 @@ type CreateUserPayload { input CreateUserInput { clientMutationId: String email: String! - image: Url + image: URL name: String! password: String! } @@ -346,10 +346,11 @@ enum Direction { OUTGOING } -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -scalar Url +"The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." +scalar URL @specifiedBy(url: "https://scalars.graphql.org/chillicream/url.html") type User { email: String! @@ -358,3 +359,6 @@ type User { } directive @authorize("The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access to the annotated resource." roles: [String!]) repeatable on OBJECT | FIELD_DEFINITION + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Expenses.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Expenses.graphql index 9644b79c656..90d52af0fda 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Expenses.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Expenses.graphql @@ -51,8 +51,8 @@ type Mutation { deleteIncome(input: DeleteIncomeInput): DeleteIncomePayload } -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") enum ExpenseCategory { UNKNOWN_EXPENSE_CATEGORY @@ -73,10 +73,11 @@ enum ExpenseCategory { PERSONAL_CARE } -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -scalar UUID +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") enum PaymentMethod { UNKNOWN_PAYMENT_METHOD @@ -308,3 +309,6 @@ input TagInput { } directive @authorize("The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access the annotated resource." roles: [String!] "Defines when when the resolver shall be executed.By default the resolver is executed after the policy has determined that the current user is allowed to access the field." apply: ApplyPolicy! = BEFORE_RESOLVER) repeatable on SCHEMA | OBJECT | FIELD_DEFINITION + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/FieldsWithUnderlinePrefix.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/FieldsWithUnderlinePrefix.graphql index b938b672ce1..2f2382c8ca0 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/FieldsWithUnderlinePrefix.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/FieldsWithUnderlinePrefix.graphql @@ -272,9 +272,9 @@ type Mutation { } """ -The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone. +The `DateTime` scalar type represents a date and time with time zone offset information. """ -scalar DateTime +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") """ The node interface is implemented by entities that have a global unique identifier. @@ -921,7 +921,8 @@ interface ICellValue { permissions: String! } -scalar Any +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interface ITypeDescription { name: String! @@ -2340,10 +2341,8 @@ type UpdateNestedPayload { _operation: String! } -""" -The `Decimal` scalar type represents a decimal floating-point number. -""" -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") input Createbwr_ImportSpecificationReferenceInput { _inventoryItemId: String = null @@ -2855,3 +2854,6 @@ input AddTimeSeriesGroupInstancesToGroupInput { name: String! issueDate: DateTime } + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/PaymentSchema.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/PaymentSchema.graphql index 91b80c4f609..58c42ae753d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/PaymentSchema.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/PaymentSchema.graphql @@ -7672,19 +7672,20 @@ directive @specifiedBy("The specifiedBy URL points to a human-readable specifica "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("Streamed when true." if: Boolean "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String) on FIELD -"The `Date` scalar represents an ISO-8601 compliant date type." -scalar Date +"The `Date` scalar type represents a date in UTC." +scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -"The `Decimal` scalar type represents a decimal floating-point number." -scalar Decimal +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") -"A date and time that is not associated with a specific time zone. A LocalDateTime value does not represent an instant on the global time line, because it has no associated time zone: \"January 12th 2021 7pm\" occurred at different instants for different people around the world." -scalar LocalDateTime +"The `LocalDateTime` scalar type represents a date and time without time zone information." +scalar LocalDateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/local-date-time.html") -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_1.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_1.graphql index d3deafa1d28..19d22d1ef69 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_1.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_1.graphql @@ -1846,10 +1846,14 @@ directive @include("Included when true." if: Boolean!) on FIELD | FRAGMENT_SPREA "Directs the executor to skip this field or fragment when the `if` argument is true." directive @skip("Skipped when true." if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR + "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! "Streamed when true." if: Boolean) on FIELD -"The `TimeSpan` scalar represents an ISO-8601 compliant duration type." -scalar TimeSpan +"The `TimeSpan` scalar type represents a duration of time." +scalar TimeSpan @specifiedBy(url: "https://scalars.graphql.org/chillicream/time-span.html") -scalar UUID +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_2.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_2.graphql index 6031f388f92..69afeafaf7b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_2.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Schema_Bug_2.graphql @@ -125,7 +125,7 @@ type ProjectStep { timeInMinutes: Int groupClassification: String media: String - mediaLinks: [Url] + mediaLinks: [URL] goals: [ProjectStepGoal] evaluation: String } @@ -142,7 +142,7 @@ type Project { createdAtUtc: DateTime! updatedAtUtc: DateTime userPermissions: ProjectUserPermissions - pdfExportUrl: Url + pdfExportUrl: URL } type Card { @@ -157,7 +157,7 @@ type UserProfile { email: String emailConfirmed: Boolean! preferredLocale: String - avatarUrl: Url + avatarUrl: URL about: String } @@ -249,7 +249,7 @@ input AddStepToProjectInput { "The media used for this step" media: String "The media links for this step" - mediaLinks: [Url]! + mediaLinks: [URL]! "The goals for this step" goals: [AddStepGoalInput]! "The evaluation for this step" @@ -407,7 +407,7 @@ input UpdateStepInput { "The media used for this step" media: String "The media links for this step" - mediaLinks: [Url]! + mediaLinks: [URL]! "The goals for this step" goals: [UpdateStepGoalInput]! "The evaluation for this step" @@ -471,7 +471,8 @@ input AddStepGoalInput { description: String } -scalar Url +"The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986." +scalar URL @specifiedBy(url: "https://scalars.graphql.org/chillicream/url.html") input AddStepTechniqueInput { "The name of the technique" @@ -515,8 +516,8 @@ type ProjectUserPermissions { canLeave: Boolean! } -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") type ProjectShareInvitation { id: Guid! @@ -528,7 +529,7 @@ type ProjectMember { id: Guid! name: String type: ProjectUserRoleType! - avatarUrl: Url + avatarUrl: URL } type ProjectGeneralInfo { @@ -558,3 +559,6 @@ enum ProjectUserRoleType { } directive @authorize("The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access the annotated resource." roles: [String!] "Defines when when the resolver shall be executed.By default the resolver is executed after the policy has determined that the current user is allowed to access the field." apply: ApplyPolicy! = BEFORE_RESOLVER) repeatable on SCHEMA | OBJECT | FIELD_DEFINITION + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/StarWarsSchema_ChangeHomePlanet.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/StarWarsSchema_ChangeHomePlanet.graphql index 6fb9dc6d5b3..8dd3c35ebfe 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/StarWarsSchema_ChangeHomePlanet.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/StarWarsSchema_ChangeHomePlanet.graphql @@ -286,7 +286,8 @@ input EpisodeOperationFilterInput { nin: [Episode!] } -scalar UUID +"The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." +scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") input CreateReviewInput { episode: Episode! @@ -311,3 +312,6 @@ type ChangeHomePlanetPayload { } union SearchResult = Human | Droid | Starship + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Workshop.Schema.graphql b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Workshop.Schema.graphql index 6995b08d2c3..b1bb0598af4 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Workshop.Schema.graphql +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__resources__/Workshop.Schema.graphql @@ -108,11 +108,11 @@ type SessionEdge { node: Session! } -"The `DateTime` scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does not use a time zone." -scalar DateTime +"The `DateTime` scalar type represents a date and time with time zone offset information." +scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") -"The `TimeSpan` scalar represents an ISO-8601 compliant duration type." -scalar TimeSpan +"The `TimeSpan` scalar type represents a duration of time." +scalar TimeSpan @specifiedBy(url: "https://scalars.graphql.org/chillicream/time-span.html") "A connection to a list of items." type AttendeeConnection { @@ -448,3 +448,6 @@ type UserError { message: String! code: String! } + +"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." +directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap index 472a66593ae..eddfb6389d1 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap @@ -4330,7 +4330,7 @@ namespace Foo.Bar.State private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer; private readonly global::StrawberryShake.Serialization.ILeafValueParser _stringParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _booleanParser; - private readonly global::StrawberryShake.Serialization.ILeafValueParser _urlParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _uRLParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _dateTimeParser; public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { @@ -4339,7 +4339,7 @@ namespace Foo.Bar.State ResultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory)); _stringParser = serializerResolver.GetLeafValueParser("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found."); _booleanParser = serializerResolver.GetLeafValueParser("Boolean") ?? throw new global::System.ArgumentException("No serializer for type `Boolean` found."); - _urlParser = serializerResolver.GetLeafValueParser("Url") ?? throw new global::System.ArgumentException("No serializer for type `Url` found."); + _uRLParser = serializerResolver.GetLeafValueParser("URL") ?? throw new global::System.ArgumentException("No serializer for type `URL` found."); _dateTimeParser = serializerResolver.GetLeafValueParser("DateTime") ?? throw new global::System.ArgumentException("No serializer for type `DateTime` found."); } @@ -4473,7 +4473,7 @@ namespace Foo.Bar.State return null; } - return _urlParser.Parse(obj.Value.GetString()!); + return _uRLParser.Parse(obj.Value.GetString()!); } private global::System.DateTimeOffset Deserialize_NonNullableDateTimeOffset(global::System.Text.Json.JsonElement? obj) @@ -6042,7 +6042,6 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, new global::StrawberryShake.Serialization.UrlSerializer("Url")); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::Foo.Bar.State.GetPeopleResultFactory>(services); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap index 36b252ee4f6..bd639e426d5 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap @@ -274,7 +274,7 @@ namespace Foo.Bar /// public global::Foo.Bar.IPeopleSearch_People_Items_Department? Department { get; } /// - /// Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. + /// URL to image, you can specify a size in pixels by appending '?size=300' to get a square image. /// public global::System.Uri? Image { get; } /// @@ -582,7 +582,7 @@ namespace Foo.Bar /// public global::Foo.Bar.IPeopleSearch_People_Items_Department? Department { get; } /// - /// Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. + /// URL to image, you can specify a size in pixels by appending '?size=300' to get a square image. /// public global::System.Uri? Image { get; } /// @@ -1023,7 +1023,7 @@ namespace Foo.Bar.State public global::System.Boolean IsActive { get; } ///The department the person belongs to. public global::StrawberryShake.EntityId? Department { get; } - ///Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. + ///URL to image, you can specify a size in pixels by appending '?size=300' to get a square image. public global::System.Uri? Image { get; } ///The job title of the person. public global::System.String Title { get; } @@ -1213,7 +1213,7 @@ namespace Foo.Bar.State private readonly global::StrawberryShake.Serialization.ILeafValueParser _booleanParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _iDParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _longParser; - private readonly global::StrawberryShake.Serialization.ILeafValueParser _urlParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _uRLParser; public PeopleSearchBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); @@ -1224,7 +1224,7 @@ namespace Foo.Bar.State _booleanParser = serializerResolver.GetLeafValueParser("Boolean") ?? throw new global::System.ArgumentException("No serializer for type `Boolean` found."); _iDParser = serializerResolver.GetLeafValueParser("ID") ?? throw new global::System.ArgumentException("No serializer for type `ID` found."); _longParser = serializerResolver.GetLeafValueParser("Long") ?? throw new global::System.ArgumentException("No serializer for type `Long` found."); - _urlParser = serializerResolver.GetLeafValueParser("Url") ?? throw new global::System.ArgumentException("No serializer for type `Url` found."); + _uRLParser = serializerResolver.GetLeafValueParser("URL") ?? throw new global::System.ArgumentException("No serializer for type `URL` found."); } protected override global::StrawberryShake.IOperationResultDataFactory ResultDataFactory { get; } @@ -1454,7 +1454,7 @@ namespace Foo.Bar.State return null; } - return _urlParser.Parse(obj.Value.GetString()!); + return _uRLParser.Parse(obj.Value.GetString()!); } private global::StrawberryShake.EntityId? Update_IPeopleSearch_People_Items_ManagerEntity(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) @@ -1751,7 +1751,6 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, new global::StrawberryShake.Serialization.UrlSerializer("Url")); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::Foo.Bar.State.PeopleSearchResultFactory>(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); diff --git a/website/src/docs/hotchocolate/v16/defining-a-schema/scalars.md b/website/src/docs/hotchocolate/v16/defining-a-schema/scalars.md index 0cbf968a37e..9143e8c1284 100644 --- a/website/src/docs/hotchocolate/v16/defining-a-schema/scalars.md +++ b/website/src/docs/hotchocolate/v16/defining-a-schema/scalars.md @@ -168,83 +168,55 @@ builder.Services Notice how our code uses `int` for the `Id`, but in a request / response it would be serialized as a `string`. This allows us to switch the CLR type of our `Id`, without affecting the schema and our clients. -# GraphQL Community Scalars - -The website hosts specifications for GraphQL scalars defined by the community. The community scalars use the `@specifiedBy` directive to point to the spec that is implemented. - -```sdl -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") -``` - -## DateTime Type - -This scalar represents an exact point in time. This point in time is specified by having an offset to UTC and does **not** use a time zone. - -It is a slightly refined version of [RFC 3339](https://tools.ietf.org/html/rfc3339), including the [errata](https://www.rfc-editor.org/errata/rfc3339). - -```sdl -scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time.html") -``` - -> Note: The Hot Chocolate implementation diverges slightly from the DateTime scalar specification, and allows fractional seconds of 0-7 digits, as opposed to exactly 3. - -