Skip to content

Commit 19b5ae5

Browse files
committed
run dotnet-format on the solution
1 parent 7660bcc commit 19b5ae5

File tree

88 files changed

+4663
-4005
lines changed

Some content is hidden

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

88 files changed

+4663
-4005
lines changed

examples/GraphQL.Client.Example/PersonAndFilmsResponse.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22

33
namespace GraphQL.Client.Http.Examples
44
{
5-
public class PersonAndFilmsResponse {
6-
public PersonContent Person { get; set; }
5+
public class PersonAndFilmsResponse
6+
{
7+
public PersonContent Person { get; set; }
78

8-
public class PersonContent {
9-
public string Name { get; set; }
10-
public FilmConnectionContent FilmConnection { get; set; }
9+
public class PersonContent
10+
{
11+
public string Name { get; set; }
12+
public FilmConnectionContent FilmConnection { get; set; }
1113

12-
public class FilmConnectionContent {
13-
public List<FilmContent> Films { get; set; }
14+
public class FilmConnectionContent
15+
{
16+
public List<FilmContent> Films { get; set; }
1417

15-
public class FilmContent {
16-
public string Title { get; set; }
17-
}
18-
}
19-
}
20-
}
18+
public class FilmContent
19+
{
20+
public string Title { get; set; }
21+
}
22+
}
23+
}
24+
}
2125
}

examples/GraphQL.Client.Example/Program.cs

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44
using System.Threading.Tasks;
55
using GraphQL.Client.Serializer.Newtonsoft;
66

7-
namespace GraphQL.Client.Http.Examples {
7+
namespace GraphQL.Client.Http.Examples
8+
{
89

9-
public class Program {
10+
public class Program
11+
{
1012

11-
public static async Task Main(string[] args) {
13+
public static async Task Main(string[] args)
14+
{
1215

13-
using var graphQLClient = new GraphQLHttpClient("https://swapi.apis.guru/");
16+
using var graphQLClient = new GraphQLHttpClient("https://swapi.apis.guru/");
1417

15-
var personAndFilmsRequest = new GraphQLRequest {
16-
Query = @"
18+
var personAndFilmsRequest = new GraphQLRequest
19+
{
20+
Query = @"
1721
query PersonAndFilms($id: ID) {
1822
person(id: $id) {
1923
name
@@ -24,25 +28,26 @@ query PersonAndFilms($id: ID) {
2428
}
2529
}
2630
}",
27-
OperationName = "PersonAndFilms",
28-
Variables = new {
29-
id = "cGVvcGxlOjE="
30-
}
31-
};
32-
33-
var graphQLResponse = await graphQLClient.SendQueryAsync<PersonAndFilmsResponse>(personAndFilmsRequest);
34-
Console.WriteLine("raw response:");
35-
Console.WriteLine(JsonSerializer.Serialize(graphQLResponse, new JsonSerializerOptions { WriteIndented = true }));
36-
37-
Console.WriteLine();
38-
Console.WriteLine($"Name: {graphQLResponse.Data.Person.Name}" );
39-
var films = string.Join(", ", graphQLResponse.Data.Person.FilmConnection.Films.Select(f => f.Title));
40-
Console.WriteLine($"Films: {films}");
41-
42-
Console.WriteLine();
43-
Console.WriteLine("Press any key to quit...");
44-
Console.ReadKey();
45-
}
46-
47-
}
31+
OperationName = "PersonAndFilms",
32+
Variables = new
33+
{
34+
id = "cGVvcGxlOjE="
35+
}
36+
};
37+
38+
var graphQLResponse = await graphQLClient.SendQueryAsync<PersonAndFilmsResponse>(personAndFilmsRequest);
39+
Console.WriteLine("raw response:");
40+
Console.WriteLine(JsonSerializer.Serialize(graphQLResponse, new JsonSerializerOptions { WriteIndented = true }));
41+
42+
Console.WriteLine();
43+
Console.WriteLine($"Name: {graphQLResponse.Data.Person.Name}");
44+
var films = string.Join(", ", graphQLResponse.Data.Person.FilmConnection.Films.Select(f => f.Title));
45+
Console.WriteLine($"Films: {films}");
46+
47+
Console.WriteLine();
48+
Console.WriteLine("Press any key to quit...");
49+
Console.ReadKey();
50+
}
51+
52+
}
4853
}
Lines changed: 77 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,89 @@
1-
namespace GraphQL.Client.Abstractions.Websocket {
2-
public static class GraphQLWebSocketMessageType {
1+
namespace GraphQL.Client.Abstractions.Websocket
2+
{
3+
public static class GraphQLWebSocketMessageType
4+
{
35

4-
/// <summary>
5-
/// Client sends this message after plain websocket connection to start the communication with the server
6-
/// The server will response only with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE(if used) or GQL_CONNECTION_ERROR
7-
/// to this message.
8-
/// payload: Object : optional parameters that the client specifies in connectionParams
9-
/// </summary>
10-
public const string GQL_CONNECTION_INIT = "connection_init";
6+
/// <summary>
7+
/// Client sends this message after plain websocket connection to start the communication with the server
8+
/// The server will response only with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE(if used) or GQL_CONNECTION_ERROR
9+
/// to this message.
10+
/// payload: Object : optional parameters that the client specifies in connectionParams
11+
/// </summary>
12+
public const string GQL_CONNECTION_INIT = "connection_init";
1113

12-
/// <summary>
13-
/// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server accepted
14-
/// the connection.
15-
/// </summary>
16-
public const string GQL_CONNECTION_ACK = "connection_ack"; // Server -> Client
14+
/// <summary>
15+
/// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server accepted
16+
/// the connection.
17+
/// </summary>
18+
public const string GQL_CONNECTION_ACK = "connection_ack"; // Server -> Client
1719

18-
/// <summary>
19-
/// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server rejected
20-
/// the connection.
21-
/// It server also respond with this message in case of a parsing errors of the message (which does not disconnect the
22-
/// client, just ignore the message).
23-
/// payload: Object: the server side error
24-
/// </summary>
25-
public const string GQL_CONNECTION_ERROR = "connection_error"; // Server -> Client
20+
/// <summary>
21+
/// The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server rejected
22+
/// the connection.
23+
/// It server also respond with this message in case of a parsing errors of the message (which does not disconnect the
24+
/// client, just ignore the message).
25+
/// payload: Object: the server side error
26+
/// </summary>
27+
public const string GQL_CONNECTION_ERROR = "connection_error"; // Server -> Client
2628

27-
/// <summary>
28-
/// Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the
29-
/// client connection alive.
30-
/// The client starts to consider the keep alive message only upon the first received keep alive message from the
31-
/// server.
32-
/// <remarks>
33-
/// NOTE: This one here don't follow the standard due to connection optimization
34-
/// </remarks>
35-
/// </summary>
36-
public const string GQL_CONNECTION_KEEP_ALIVE = "ka"; // Server -> Client
29+
/// <summary>
30+
/// Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the
31+
/// client connection alive.
32+
/// The client starts to consider the keep alive message only upon the first received keep alive message from the
33+
/// server.
34+
/// <remarks>
35+
/// NOTE: This one here don't follow the standard due to connection optimization
36+
/// </remarks>
37+
/// </summary>
38+
public const string GQL_CONNECTION_KEEP_ALIVE = "ka"; // Server -> Client
3739

38-
/// <summary>
39-
/// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe)
40-
/// id: string : operation id
41-
/// </summary>
42-
public const string GQL_CONNECTION_TERMINATE = "connection_terminate"; // Client -> Server
40+
/// <summary>
41+
/// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe)
42+
/// id: string : operation id
43+
/// </summary>
44+
public const string GQL_CONNECTION_TERMINATE = "connection_terminate"; // Client -> Server
4345

44-
/// <summary>
45-
/// Client sends this message to execute GraphQL operation
46-
/// id: string : The id of the GraphQL operation to start
47-
/// payload: Object:
48-
/// query: string : GraphQL operation as string or parsed GraphQL document node
49-
/// variables?: Object : Object with GraphQL variables
50-
/// operationName?: string : GraphQL operation name
51-
/// </summary>
52-
public const string GQL_START = "start";
46+
/// <summary>
47+
/// Client sends this message to execute GraphQL operation
48+
/// id: string : The id of the GraphQL operation to start
49+
/// payload: Object:
50+
/// query: string : GraphQL operation as string or parsed GraphQL document node
51+
/// variables?: Object : Object with GraphQL variables
52+
/// operationName?: string : GraphQL operation name
53+
/// </summary>
54+
public const string GQL_START = "start";
5355

54-
/// <summary>
55-
/// The server sends this message to transfer the GraphQL execution result from the server to the client, this message
56-
/// is a response for GQL_START message.
57-
/// For each GraphQL operation send with GQL_START, the server will respond with at least one GQL_DATA message.
58-
/// id: string : ID of the operation that was successfully set up
59-
/// payload: Object :
60-
/// data: any: Execution result
61-
/// errors?: Error[] : Array of resolvers errors
62-
/// </summary>
63-
public const string GQL_DATA = "data"; // Server -> Client
56+
/// <summary>
57+
/// The server sends this message to transfer the GraphQL execution result from the server to the client, this message
58+
/// is a response for GQL_START message.
59+
/// For each GraphQL operation send with GQL_START, the server will respond with at least one GQL_DATA message.
60+
/// id: string : ID of the operation that was successfully set up
61+
/// payload: Object :
62+
/// data: any: Execution result
63+
/// errors?: Error[] : Array of resolvers errors
64+
/// </summary>
65+
public const string GQL_DATA = "data"; // Server -> Client
6466

65-
/// <summary>
66-
/// Server sends this message upon a failing operation, before the GraphQL execution, usually due to GraphQL validation
67-
/// errors (resolver errors are part of GQL_DATA message, and will be added as errors array)
68-
/// payload: Error : payload with the error attributed to the operation failing on the server
69-
/// id: string : operation ID of the operation that failed on the server
70-
/// </summary>
71-
public const string GQL_ERROR = "error"; // Server -> Client
67+
/// <summary>
68+
/// Server sends this message upon a failing operation, before the GraphQL execution, usually due to GraphQL validation
69+
/// errors (resolver errors are part of GQL_DATA message, and will be added as errors array)
70+
/// payload: Error : payload with the error attributed to the operation failing on the server
71+
/// id: string : operation ID of the operation that failed on the server
72+
/// </summary>
73+
public const string GQL_ERROR = "error"; // Server -> Client
7274

73-
/// <summary>
74-
/// Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the
75-
/// specific operation.
76-
/// id: string : operation ID of the operation that completed
77-
/// </summary>
78-
public const string GQL_COMPLETE = "complete"; // Server -> Client
75+
/// <summary>
76+
/// Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the
77+
/// specific operation.
78+
/// id: string : operation ID of the operation that completed
79+
/// </summary>
80+
public const string GQL_COMPLETE = "complete"; // Server -> Client
7981

80-
/// <summary>
81-
/// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe)
82-
/// id: string : operation id
83-
/// </summary>
84-
public const string GQL_STOP = "stop"; // Client -> Server
82+
/// <summary>
83+
/// Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe)
84+
/// id: string : operation id
85+
/// </summary>
86+
public const string GQL_STOP = "stop"; // Client -> Server
8587

86-
}
88+
}
8789
}

0 commit comments

Comments
 (0)