-
Notifications
You must be signed in to change notification settings - Fork 310
HotChocolate 16 Milestone 11 Migration #3136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,8 +100,8 @@ public static FieldDefinitionNode GenerateStoredProcedureSchema( | |
|
|
||
| /// <summary> | ||
| /// Takes the result from DB as JsonDocument and formats it in a way that can be filtered by column | ||
| /// name. It parses the Json document into a list of Dictionary with key as result_column_name | ||
| /// with it's corresponding value. | ||
| /// name. It parses the JSON document into a list of Dictionary with key as result_column_name | ||
| /// with its corresponding value. | ||
| /// returns an empty list in case of no result | ||
| /// or stored-procedure is trying to read from DB without READ permission. | ||
| /// </summary> | ||
|
|
@@ -156,12 +156,12 @@ private static Tuple<string, IValueNode> ConvertValueToGraphQLType(string defaul | |
| { | ||
| Tuple<string, IValueNode> valueNode = paramValueType switch | ||
| { | ||
| UUID_TYPE => new(UUID_TYPE, new UuidType().ParseValue(Guid.Parse(defaultValueFromConfig))), | ||
| UUID_TYPE => new(UUID_TYPE, new UuidType().ValueToLiteral(Guid.Parse(defaultValueFromConfig))), | ||
| BYTE_TYPE => new(BYTE_TYPE, new IntValueNode(byte.Parse(defaultValueFromConfig))), | ||
| SHORT_TYPE => new(SHORT_TYPE, new IntValueNode(short.Parse(defaultValueFromConfig))), | ||
| INT_TYPE => new(INT_TYPE, new IntValueNode(int.Parse(defaultValueFromConfig))), | ||
| LONG_TYPE => new(LONG_TYPE, new IntValueNode(long.Parse(defaultValueFromConfig))), | ||
| SINGLE_TYPE => new(SINGLE_TYPE, new SingleType().ParseValue(float.Parse(defaultValueFromConfig))), | ||
| SINGLE_TYPE => new(SINGLE_TYPE, new SingleType().ValueToLiteral(float.Parse(defaultValueFromConfig))), | ||
| FLOAT_TYPE => new(FLOAT_TYPE, new FloatValueNode(double.Parse(defaultValueFromConfig))), | ||
| DECIMAL_TYPE => new(DECIMAL_TYPE, new FloatValueNode(decimal.Parse(defaultValueFromConfig))), | ||
| STRING_TYPE => new(STRING_TYPE, new StringValueNode(defaultValueFromConfig)), | ||
|
|
@@ -174,10 +174,10 @@ var s when s.Equals("true", StringComparison.OrdinalIgnoreCase) => true, | |
| var s when s.Equals("false", StringComparison.OrdinalIgnoreCase) => false, | ||
| _ => throw new FormatException($"String '{defaultValueFromConfig}' was not recognized as a valid Boolean.") | ||
| })), | ||
| DATETIME_TYPE => new(DATETIME_TYPE, new DateTimeType().ParseResult( | ||
| DATETIME_TYPE => new(DATETIME_TYPE, new DateTimeType().ValueToLiteral( | ||
| DateTime.Parse(defaultValueFromConfig, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AssumeUniversal))), | ||
| BYTEARRAY_TYPE => new(BYTEARRAY_TYPE, new ByteArrayType().ParseValue(Convert.FromBase64String(defaultValueFromConfig))), | ||
| LOCALTIME_TYPE => new(LOCALTIME_TYPE, new HotChocolate.Types.NodaTime.LocalTimeType().ParseResult(LocalTimePattern.ExtendedIso.Parse(defaultValueFromConfig).Value)), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do both
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh ... overlooked this one... Its mainly naming ... the reference implementation created a better naming for scalar the conversion tasks as scalar has. We adopted this change to Hot Chocolate. I will however look at this change more closely. |
||
| BYTEARRAY_TYPE => new(BYTEARRAY_TYPE, new Base64StringType().ValueToLiteral(Convert.FromBase64String(defaultValueFromConfig))), | ||
| LOCALTIME_TYPE => new(LOCALTIME_TYPE, new HotChocolate.Types.NodaTime.LocalTimeType().ValueToLiteral(LocalTimePattern.ExtendedIso.Parse(defaultValueFromConfig).Value)), | ||
| _ => throw new NotSupportedException(message: $"The {defaultValueFromConfig} parameter's value type [{paramValueType}] is not supported.") | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.