Skip to content
Merged

Cleanup #9178

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ public async Task AddToolAsync(

if (_session.Exists(viewPath))
{
await using var componentStream = await _session.OpenReadAsync(
await using var viewStream = await _session.OpenReadAsync(
viewPath,
FileKind.View,
cancellationToken);
await componentStream.CopyToAsync(buffer, cancellationToken);
await viewStream.CopyToAsync(buffer, cancellationToken);
view = buffer.WrittenMemory.ToArray();
buffer.Clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,4 @@
</Compile>
</ItemGroup>

<ItemGroup>
<Folder Include="BaseTypes\" />
</ItemGroup>

</Project>
78 changes: 0 additions & 78 deletions src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,6 @@ public static class Scalars
{ ScalarNames.UUID, typeof(UuidType) }
};

private static readonly Dictionary<Type, ValueKind> s_scalarKinds = new()
{
{ typeof(bool?), ValueKind.Boolean },
{ typeof(bool), ValueKind.Boolean },
{ typeof(byte?), ValueKind.Integer },
{ typeof(byte), ValueKind.Integer },
{ typeof(decimal?), ValueKind.Float },
{ typeof(decimal), ValueKind.Float },
{ typeof(double?), ValueKind.Float },
{ typeof(double), ValueKind.Float },
{ typeof(float?), ValueKind.Float },
{ typeof(float), ValueKind.Float },
{ typeof(int?), ValueKind.Integer },
{ typeof(int), ValueKind.Integer },
{ typeof(long?), ValueKind.Integer },
{ typeof(long), ValueKind.Integer },
{ typeof(sbyte?), ValueKind.Integer },
{ typeof(sbyte), ValueKind.Integer },
{ typeof(short?), ValueKind.Integer },
{ typeof(short), ValueKind.Integer },
{ typeof(string), ValueKind.String },
{ typeof(uint?), ValueKind.Integer },
{ typeof(uint), ValueKind.Integer },
{ typeof(ulong?), ValueKind.Integer },
{ typeof(ulong), ValueKind.Integer },
{ typeof(ushort?), ValueKind.Integer },
{ typeof(ushort), ValueKind.Integer }
};

private static readonly HashSet<string> s_specScalars =
[
ScalarNames.ID,
Expand Down Expand Up @@ -134,55 +105,6 @@ public static bool IsBuiltIn(string typeName)
=> !string.IsNullOrEmpty(typeName)
&& s_nameLookup.ContainsKey(typeName);

Comment thread
glen-84 marked this conversation as resolved.
/// <summary>
/// Tries to infer the GraphQL literal kind from a runtime value.
/// </summary>
/// <param name="value">
/// The runtime value.
/// </param>
/// <param name="kind">
/// The expected GraphQL literal kind.
/// </param>
/// <returns>
/// <c>true</c> if the literal kind can be inferred.
/// </returns>
public static bool TryGetKind(object? value, out ValueKind kind)
{
if (value is null)
{
kind = ValueKind.Null;
return true;
}

var valueType = value.GetType();

if (valueType.IsEnum)
{
kind = ValueKind.Enum;
return true;
}

if (s_scalarKinds.TryGetValue(valueType, out kind))
{
return true;
}

if (value is IDictionary)
{
kind = ValueKind.Object;
return true;
}

if (value is ICollection)
{
kind = ValueKind.List;
return true;
}

kind = ValueKind.Unknown;
return false;
}

internal static bool IsSpec(string typeName)
=> s_specScalars.Contains(typeName);
}
144 changes: 0 additions & 144 deletions src/HotChocolate/Core/test/Types.Tests/Types/Scalars/ScalarsTests.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Nitro/CommandLine/src/CommandLine/.graphqlrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"name": "ApiClient",
"namespace": "ChilliCream.Nitro.CommandLine.Client",
"url": "https://api.chillicream.cloud/graphql/",
"dependencyInjection": true,
"emitGeneratedCode": true,
"noStore": true,
"records": {
Expand Down
Loading
Loading