Skip to content

Commit 4e07ff1

Browse files
authored
Merge pull request #212 from sungam3r/code-cleanup
spell check, formatting, code cleanup
2 parents aadf594 + 51f313d commit 4e07ff1

File tree

73 files changed

+241
-376
lines changed

Some content is hidden

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

73 files changed

+241
-376
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
<IsPackable>false</IsPackable>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
88

9-
<ItemGroup>
10-
<ProjectReference Include="..\..\src\GraphQL.Client.Serializer.Newtonsoft\GraphQL.Client.Serializer.Newtonsoft.csproj" />
11-
<ProjectReference Include="..\..\src\GraphQL.Client\GraphQL.Client.csproj" />
12-
</ItemGroup>
9+
<ItemGroup>
10+
<ProjectReference Include="..\..\src\GraphQL.Client.Serializer.Newtonsoft\GraphQL.Client.Serializer.Newtonsoft.csproj" />
11+
<ProjectReference Include="..\..\src\GraphQL.Client\GraphQL.Client.csproj" />
12+
</ItemGroup>
1313

1414
</Project>

examples/GraphQL.Client.Example/PersonAndFilmsResponse.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class PersonAndFilmsResponse
99
public class PersonContent
1010
{
1111
public string Name { get; set; }
12+
1213
public FilmConnectionContent FilmConnection { get; set; }
1314

1415
public class FilmConnectionContent

examples/GraphQL.Client.Example/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77

88
namespace GraphQL.Client.Example
99
{
10-
1110
public class Program
1211
{
13-
14-
public static async Task Main(string[] args)
12+
public static async Task Main()
1513
{
16-
_ = args;
1714
using var graphQLClient = new GraphQLHttpClient("https://swapi.apis.guru/", new NewtonsoftJsonSerializer());
1815

1916
var personAndFilmsRequest = new GraphQLRequest
@@ -49,6 +46,5 @@ query PersonAndFilms($id: ID) {
4946
Console.WriteLine("Press any key to quit...");
5047
Console.ReadKey();
5148
}
52-
5349
}
5450
}

root.props

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<Project>
32

4-
<PropertyGroup>
5-
<Authors>Deinok,Alexander Rose,graphql-dotnet</Authors>
6-
<Description>A GraphQL Client for .NET Standard</Description>
7-
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
8-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
9-
<LangVersion>8.0</LangVersion>
10-
<NeutralLanguage>en-US</NeutralLanguage>
11-
<NoWarn>CS0618;CS1591;CS1701;CS8618;CS8632;NU5048;NU5105;NU5125</NoWarn>
12-
<Nullable>annotations</Nullable>
13-
<PackageIcon>icon.png</PackageIcon>
14-
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
15-
<PackageProjectUrl>https://github.com/graphql-dotnet/graphql-client</PackageProjectUrl>
16-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
17-
<PackageTags>GraphQL</PackageTags>
18-
<RepositoryType>git</RepositoryType>
19-
<RepositoryUrl>https://github.com/graphql-dotnet/graphql-client</RepositoryUrl>
20-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
21-
<WarningLevel>4</WarningLevel>
22-
</PropertyGroup>
3+
<PropertyGroup>
4+
<Authors>Deinok,Alexander Rose,graphql-dotnet</Authors>
5+
<Description>A GraphQL Client for .NET Standard</Description>
6+
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
7+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
8+
<LangVersion>8.0</LangVersion>
9+
<NeutralLanguage>en-US</NeutralLanguage>
10+
<NoWarn>$(NoWarn);CS1591;NU5048;NU5105;NU5125</NoWarn>
11+
<Nullable>annotations</Nullable>
12+
<PackageIcon>icon.png</PackageIcon>
13+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
14+
<PackageProjectUrl>https://github.com/graphql-dotnet/graphql-client</PackageProjectUrl>
15+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
16+
<PackageTags>GraphQL</PackageTags>
17+
<RepositoryType>git</RepositoryType>
18+
<RepositoryUrl>https://github.com/graphql-dotnet/graphql-client</RepositoryUrl>
19+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
20+
<WarningLevel>4</WarningLevel>
21+
</PropertyGroup>
2322

24-
<ItemGroup>
25-
<Content Include="$(MSBuildThisFileDirectory)/LICENSE.txt">
26-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27-
<Pack>true</Pack>
28-
<PackagePath>LICENSE.txt</PackagePath>
29-
<Visible>false</Visible>
30-
</Content>
31-
<Content Include="$(MSBuildThisFileDirectory)/assets/logo.64x64.png">
32-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33-
<Pack>true</Pack>
34-
<PackagePath>icon.png</PackagePath>
35-
<Visible>false</Visible>
36-
</Content>
37-
</ItemGroup>
23+
<ItemGroup>
24+
<Content Include="$(MSBuildThisFileDirectory)/LICENSE.txt">
25+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26+
<Pack>true</Pack>
27+
<PackagePath>LICENSE.txt</PackagePath>
28+
<Visible>false</Visible>
29+
</Content>
30+
<Content Include="$(MSBuildThisFileDirectory)/assets/logo.64x64.png">
31+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32+
<Pack>true</Pack>
33+
<PackagePath>icon.png</PackagePath>
34+
<Visible>false</Visible>
35+
</Content>
36+
</ItemGroup>
3837

3938
</Project>
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="../src.props" />
2+
3+
<Import Project="../src.props" />
34

4-
<PropertyGroup>
5+
<PropertyGroup>
56
<Description>Abstractions for the Websocket transport used in GraphQL.Client</Description>
67
<TargetFramework>netstandard2.0</TargetFramework>
7-
</PropertyGroup>
8+
</PropertyGroup>
89

9-
<ItemGroup>
10-
<ProjectReference Include="..\GraphQL.Client.Abstractions\GraphQL.Client.Abstractions.csproj" />
11-
</ItemGroup>
10+
<ItemGroup>
11+
<ProjectReference Include="..\GraphQL.Client.Abstractions\GraphQL.Client.Abstractions.csproj" />
12+
</ItemGroup>
1213

1314
</Project>

src/GraphQL.Client.Abstractions.Websocket/GraphQLWebSocketMessageType.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,5 @@ public static class GraphQLWebSocketMessageType
8484
/// id: string : operation id
8585
/// </summary>
8686
public const string GQL_STOP = "stop"; // Client -> Server
87-
8887
}
8988
}

src/GraphQL.Client.Abstractions.Websocket/GraphQLWebSocketRequest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace GraphQL.Client.Abstractions.Websocket
66
{
7-
87
/// <summary>
98
/// A Subscription Request
109
/// </summary>
@@ -50,7 +49,7 @@ public GraphQLRequest Payload
5049
public Task SendTask() => _tcs.Task;
5150

5251
/// <summary>
53-
/// gets called when the send operation for this request has completed sucessfully
52+
/// gets called when the send operation for this request has completed successfully
5453
/// </summary>
5554
public void SendCompleted() => _tcs.SetResult(true);
5655

@@ -109,7 +108,5 @@ public override int GetHashCode()
109108

110109
/// <inheritdoc />
111110
public static bool operator !=(GraphQLWebSocketRequest request1, GraphQLWebSocketRequest request2) => !(request1 == request2);
112-
113111
}
114-
115112
}

src/GraphQL.Client.Abstractions.Websocket/GraphQLWebSocketResponse.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33

44
namespace GraphQL.Client.Abstractions.Websocket
55
{
6-
76
/// <summary>
87
/// A Subscription Response
98
/// </summary>
109
public class GraphQLWebSocketResponse : IEquatable<GraphQLWebSocketResponse>
1110
{
12-
1311
/// <summary>
1412
/// The Identifier of the Response
1513
/// </summary>
@@ -65,7 +63,6 @@ public override int GetHashCode()
6563
/// <inheritdoc />
6664
public static bool operator !=(GraphQLWebSocketResponse response1, GraphQLWebSocketResponse response2) =>
6765
!(response1 == response2);
68-
6966
}
7067

7168
public class GraphQLWebSocketResponse<TPayload> : GraphQLWebSocketResponse, IEquatable<GraphQLWebSocketResponse<TPayload>>

src/GraphQL.Client.Abstractions.Websocket/GraphQLWebsocketConnectionState.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ namespace GraphQL.Client.Abstractions.Websocket
33
public enum GraphQLWebsocketConnectionState
44
{
55
Disconnected,
6+
67
Connecting,
8+
79
Connected
810
}
911
}

src/GraphQL.Client.Abstractions.Websocket/IGraphQLWebsocketJsonSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IGraphQLWebsocketJsonSerializer : IGraphQLJsonSerializer
1212
byte[] SerializeToBytes(GraphQLWebSocketRequest request);
1313

1414
Task<WebsocketMessageWrapper> DeserializeToWebsocketResponseWrapperAsync(Stream stream);
15-
GraphQLWebSocketResponse<GraphQLResponse<TResponse>> DeserializeToWebsocketResponse<TResponse>(byte[] bytes);
1615

16+
GraphQLWebSocketResponse<GraphQLResponse<TResponse>> DeserializeToWebsocketResponse<TResponse>(byte[] bytes);
1717
}
1818
}
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Import Project="../src.props" />
3+
<Import Project="../src.props" />
44

5-
<PropertyGroup>
6-
<Description>Abstractions for GraphQL.Client</Description>
7-
<RootNamespace>GraphQL.Client.Abstractions</RootNamespace>
8-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
9-
</PropertyGroup>
5+
<PropertyGroup>
6+
<Description>Abstractions for GraphQL.Client</Description>
7+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
8+
</PropertyGroup>
109

11-
<ItemGroup>
12-
<ProjectReference Include="..\GraphQL.Primitives\GraphQL.Primitives.csproj" />
13-
</ItemGroup>
10+
<ItemGroup>
11+
<ProjectReference Include="..\GraphQL.Primitives\GraphQL.Primitives.csproj" />
12+
</ItemGroup>
1413

15-
<ItemGroup>
16-
<PackageReference Include="System.Reactive" Version="4.3.2" />
17-
</ItemGroup>
14+
<ItemGroup>
15+
<PackageReference Include="System.Reactive" Version="4.3.2" />
16+
</ItemGroup>
1817

1918
</Project>

src/GraphQL.Client.Abstractions/IGraphQLClient.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55

66
namespace GraphQL.Client.Abstractions
77
{
8-
98
public interface IGraphQLClient : IDisposable
109
{
11-
1210
Task<GraphQLResponse<TResponse>> SendQueryAsync<TResponse>(GraphQLRequest request, CancellationToken cancellationToken = default);
1311

1412
Task<GraphQLResponse<TResponse>> SendMutationAsync<TResponse>(GraphQLRequest request, CancellationToken cancellationToken = default);
@@ -30,9 +28,8 @@ public interface IGraphQLClient : IDisposable
3028
/// Any exception thrown by <paramref name="exceptionHandler"/> will cause the sequence to fail.
3129
/// </summary>
3230
/// <param name="request">the GraphQL request for this subscription</param>
33-
/// <param name="exceptionHandler">an external handler for all <see cref="Exception"/>s occuring within the sequence</param>
31+
/// <param name="exceptionHandler">an external handler for all <see cref="Exception"/>s occurring within the sequence</param>
3432
/// <returns>an observable stream for the specified subscription</returns>
3533
IObservable<GraphQLResponse<TResponse>> CreateSubscriptionStream<TResponse>(GraphQLRequest request, Action<Exception> exceptionHandler);
3634
}
37-
3835
}

src/GraphQL.Client.Abstractions/IGraphQLJsonSerializer.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ public interface IGraphQLJsonSerializer
88
{
99
string SerializeToString(GraphQLRequest request);
1010

11-
Task<GraphQLResponse<TResponse>> DeserializeFromUtf8StreamAsync<TResponse>(Stream stream,
12-
CancellationToken cancellationToken);
11+
Task<GraphQLResponse<TResponse>> DeserializeFromUtf8StreamAsync<TResponse>(Stream stream, CancellationToken cancellationToken);
1312
}
14-
15-
1613
}

src/GraphQL.Client.LocalExecution/ExecutionResultExtensions.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Import Project="../src.props" />
3+
<Import Project="../src.props" />
44

5-
<PropertyGroup>
6-
<Description>A GraphQL Client which executes the queries directly on a provided GraphQL schema using graphql-dotnet</Description>
7-
<TargetFramework>netstandard2.0</TargetFramework>
8-
</PropertyGroup>
5+
<PropertyGroup>
6+
<Description>A GraphQL Client which executes the queries directly on a provided GraphQL schema using graphql-dotnet</Description>
7+
<TargetFramework>netstandard2.0</TargetFramework>
8+
</PropertyGroup>
99

10-
<ItemGroup>
11-
<PackageReference Include="GraphQL" Version="2.4.0" />
12-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
13-
<PackageReference Include="System.Reactive.Compatibility" Version="4.3.2" />
14-
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="GraphQL" Version="2.4.0" />
12+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
13+
<PackageReference Include="System.Reactive.Compatibility" Version="4.3.2" />
14+
</ItemGroup>
1515

16-
<ItemGroup>
17-
<ProjectReference Include="..\GraphQL.Client.Abstractions\GraphQL.Client.Abstractions.csproj" />
18-
</ItemGroup>
16+
<ItemGroup>
17+
<ProjectReference Include="..\GraphQL.Client.Abstractions\GraphQL.Client.Abstractions.csproj" />
18+
</ItemGroup>
1919

2020
</Project>

src/GraphQL.Client.LocalExecution/GraphQLEnumConverter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
3434
}
3535
}
3636
}
37-
3837
}

src/GraphQL.Client.LocalExecution/GraphQLLocalExecutionClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ public static GraphQLLocalExecutionClient<TSchema> New<TSchema>(TSchema schema,
2222
=> new GraphQLLocalExecutionClient<TSchema>(schema, serializer);
2323
}
2424

25-
2625
public class GraphQLLocalExecutionClient<TSchema> : IGraphQLClient where TSchema : ISchema
2726
{
28-
2927
private static readonly JsonSerializerSettings _variablesSerializerSettings = new JsonSerializerSettings
3028
{
3129
Formatting = Formatting.Indented,
@@ -38,8 +36,8 @@ public class GraphQLLocalExecutionClient<TSchema> : IGraphQLClient where TSchema
3836
};
3937

4038
public TSchema Schema { get; }
41-
public IGraphQLJsonSerializer Serializer { get; }
4239

40+
public IGraphQLJsonSerializer Serializer { get; }
4341

4442
private readonly DocumentExecuter _documentExecuter;
4543

src/GraphQL.Client.Serializer.Newtonsoft/GraphQL.Client.Serializer.Newtonsoft.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="../src.props" />
2+
3+
<Import Project="../src.props" />
34

45
<PropertyGroup>
56
<Description>A serializer implementation for GraphQL.Client using Newtonsoft.Json as underlying JSON library</Description>

0 commit comments

Comments
 (0)