Skip to content

Commit 4adca9e

Browse files
authored
Moved LocalDate/LocalTime to HotChocolate.Types and added LocalDateTime (#7749)
1 parent d97d21a commit 4adca9e

File tree

42 files changed

+3698
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3698
-1849
lines changed

src/HotChocolate/Core/src/Types.Scalars/ScalarResources.Designer.cs

-55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/HotChocolate/Core/src/Types.Scalars/ScalarResources.resx

-18
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,6 @@
189189
<data name="IsbnType_IsInvalid_ParseValue" xml:space="preserve">
190190
<value>IsbnType cannot parse the provided value. The provided value is not a valid ISBN number.</value>
191191
</data>
192-
<data name="LocalDateType_Description" xml:space="preserve">
193-
<value>The `LocalDate` scalar type represents a ISO date string, represented as UTF-8 character sequences YYYY-MM-DD. The scalar follows the specification defined in RFC3339</value>
194-
</data>
195-
<data name="LocalDateType_IsInvalid_ParseLiteral" xml:space="preserve">
196-
<value>LocalDateType cannot parse the provided literal. The provided value is not a valid Local Date.</value>
197-
</data>
198-
<data name="LocalDateType_IsInvalid_ParseValue" xml:space="preserve">
199-
<value>LocalDateType cannot parse the provided value. The provided value is not a valid Local Date.</value>
200-
</data>
201192
<data name="LatitudeType_Description" xml:space="preserve">
202193
<value>The Latitude scalar type represents represents a valid decimal degrees latitude number.</value>
203194
</data>
@@ -207,15 +198,6 @@
207198
<data name="LatitudeType_IsInvalid_ParseValue" xml:space="preserve">
208199
<value>LatitudeType cannot parse the provided value. The provided value was not a valid decimal degrees latitude number.</value>
209200
</data>
210-
<data name="LocalTimeType_Description" xml:space="preserve">
211-
<value>The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss.</value>
212-
</data>
213-
<data name="LocalTimeType_IsInvalid_ParseLiteral" xml:space="preserve">
214-
<value>LocalTimeType cannot parse the provided literal. The provided value is not a valid Local Time.</value>
215-
</data>
216-
<data name="LocalTimeType_IsInvalid_ParseValue" xml:space="preserve">
217-
<value>LocalTimeType cannot parse the provided value. The provided value is not a valid Local Time.</value>
218-
</data>
219201
<data name="LocalCurrencyType_Description" xml:space="preserve">
220202
<value>The LocalCurrency scalar type is a currency string.</value>
221203
</data>

src/HotChocolate/Core/src/Types.Scalars/ThrowHelper.cs

+1-45
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,6 @@ public static SerializationException LatitudeType_ParseLiteral_IsInvalid(IType t
178178
type);
179179
}
180180

181-
public static SerializationException LocalDateType_ParseValue_IsInvalid(IType type)
182-
{
183-
return new SerializationException(
184-
ErrorBuilder.New()
185-
.SetMessage(ScalarResources.LocalDateType_IsInvalid_ParseValue)
186-
.SetCode(ErrorCodes.Scalars.InvalidRuntimeType)
187-
.SetExtension("actualType", WellKnownScalarTypes.LocalDate)
188-
.Build(),
189-
type);
190-
}
191-
192-
public static SerializationException LocalDateType_ParseLiteral_IsInvalid(IType type)
193-
{
194-
return new SerializationException(
195-
ErrorBuilder.New()
196-
.SetMessage(ScalarResources.LocalDateType_IsInvalid_ParseLiteral)
197-
.SetCode(ErrorCodes.Scalars.InvalidSyntaxFormat)
198-
.SetExtension("actualType", WellKnownScalarTypes.LocalDate)
199-
.Build(),
200-
type);
201-
}
202-
203181
public static SerializationException LocalCurrencyType_ParseValue_IsInvalid(IType type)
204182
{
205183
return new SerializationException(
@@ -215,35 +193,13 @@ public static SerializationException LocalCurrencyType_ParseLiteral_IsInvalid(IT
215193
{
216194
return new SerializationException(
217195
ErrorBuilder.New()
218-
.SetMessage(ScalarResources.LocalDateType_IsInvalid_ParseLiteral)
196+
.SetMessage(ScalarResources.LocalCurrencyType_IsInvalid_ParseLiteral)
219197
.SetCode(ErrorCodes.Scalars.InvalidSyntaxFormat)
220198
.SetExtension("actualType", WellKnownScalarTypes.LocalCurrency)
221199
.Build(),
222200
type);
223201
}
224202

225-
public static SerializationException LocalTimeType_ParseValue_IsInvalid(IType type)
226-
{
227-
return new SerializationException(
228-
ErrorBuilder.New()
229-
.SetMessage(ScalarResources.LocalTimeType_IsInvalid_ParseValue)
230-
.SetCode(ErrorCodes.Scalars.InvalidRuntimeType)
231-
.SetExtension("actualType", WellKnownScalarTypes.LocalTime)
232-
.Build(),
233-
type);
234-
}
235-
236-
public static SerializationException LocalTimeType_ParseLiteral_IsInvalid(IType type)
237-
{
238-
return new SerializationException(
239-
ErrorBuilder.New()
240-
.SetMessage(ScalarResources.LocalTimeType_IsInvalid_ParseLiteral)
241-
.SetCode(ErrorCodes.Scalars.InvalidSyntaxFormat)
242-
.SetExtension("actualType", WellKnownScalarTypes.LocalTime)
243-
.Build(),
244-
type);
245-
}
246-
247203
public static SerializationException LongitudeType_ParseValue_IsInvalid(IType type)
248204
{
249205
return new SerializationException(

src/HotChocolate/Core/src/Types.Scalars/WellKnownScalarTypes.cs

-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ internal static class WellKnownScalarTypes
1010
public const string IPv6 = nameof(IPv6);
1111
public const string Isbn = nameof(Isbn);
1212
public const string Latitude = nameof(Latitude);
13-
public const string LocalDate = nameof(LocalDate);
1413
public const string LocalCurrency = nameof(LocalCurrency);
15-
public const string LocalTime = nameof(LocalTime);
1614
public const string Longitude = nameof(Longitude);
1715
public const string MacAddress = nameof(MacAddress);
1816
public const string NegativeFloat = nameof(NegativeFloat);

0 commit comments

Comments
 (0)