Skip to content
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

Fixed warnings in HotChocolate.Spatial #4938

Merged
merged 3 commits into from
Apr 5, 2022
Merged
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 @@ -4,6 +4,9 @@
<PackageId>HotChocolate.Data.Spatial</PackageId>
<RootNamespace>HotChocolate.Data</RootNamespace>
<Nullable>enable</Nullable>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
<Description>Contains extensions for seamless integration of NetTopologySuite into the HotChocolate.Data package</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<AssemblyName>HotChocolate.Types.Spatial</AssemblyName>
<RootNamespace>HotChocolate.Types.Spatial</RootNamespace>
<Nullable>enable</Nullable>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
<Description>Contains types for HotChocolate to expose NetTopologySuite as GeoJSON</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using static HotChocolate.Types.Spatial.ThrowHelper;
using static HotChocolate.Types.Spatial.WellKnownFields;
using static HotChocolate.Types.Spatial.Serialization.GeoJsonSerializers;
using static HotChocolate.Types.Spatial.Properties.Resources;

namespace HotChocolate.Types.Spatial.Serialization
{
Expand Down Expand Up @@ -116,8 +115,8 @@ public IValueNode ParseResult(IType type, object? resultValue)
}

if (GeoJsonTypeSerializer.Default.TryParseString(
typeName,
out GeoJsonGeometryType kind))
typeName,
out GeoJsonGeometryType kind))
{
return Serializers[kind].ParseResult(type, resultValue);
}
Expand Down Expand Up @@ -226,8 +225,8 @@ public IValueNode ParseValue(IType type, object? runtimeValue)
}

if (GeoJsonTypeSerializer.Default.TryParseString(
typeName,
out GeoJsonGeometryType kind))
typeName,
out GeoJsonGeometryType kind))
{
return Serializers[kind].Deserialize(type, resultValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ internal interface IGeoJsonSerializer
bool TrySerialize(
IType type,
object? runtimeValue,
[NotNullWhen(true)] out object? resultValue);
out object? resultValue);

/// <summary>
/// Parses the GraphQL value syntax of this type into a runtime value representation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Spatial.Data.Filters.SqlServer.Tests</AssemblyName>
<RootNamespace>HotChocolate.Spatial</RootNamespace>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Data.Projections.Spatial.SqlServer</AssemblyName>
<RootNamespace>HotChocolate.Data.Projections</RootNamespace>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,13 @@ public class TestModels
public class Foo
{
[GraphQLType(typeof(GeometryType))]
public Geometry Bar { get; set; }
public Geometry? Bar { get; set; }
}

public class FooNullable
{
[GraphQLType(typeof(GeometryType))]
public Geometry Bar { get; set; }
public Geometry? Bar { get; set; }
}

public class FooFilterType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class FooDirective

public class Foo
{
public string Bar { get; set; }
public string Bar { get; set; } = default!;
}

public class Query
Expand All @@ -137,13 +137,13 @@ public class Book
public int Id { get; set; }

[GraphQLNonNullType]
public string Title { get; set; }
public string Title { get; set; } = default!;

public int Pages { get; set; }
public int Chapters { get; set; }

[GraphQLNonNullType]
public Author Author { get; set; }
public Author Author { get; set; } = default!;
}

public class Author
Expand All @@ -152,7 +152,7 @@ public class Author
public int Id { get; set; }

[GraphQLNonNullType]
public string Name { get; set; }
public string Name { get; set; } = default!;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Data.Spatial.Tests</AssemblyName>
<RootNamespace>HotChocolate</RootNamespace>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Types.Spatial.Tests</AssemblyName>
<RootNamespace>HotChocolate.Types.Spatial</RootNamespace>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
Expand Down