From 0f5cbae1136f45e3c89119f58405987753ed280f Mon Sep 17 00:00:00 2001 From: Raul Hidalgo Caballero Date: Mon, 7 May 2018 21:18:50 +0200 Subject: [PATCH 1/3] ., --- src/GraphQL.Client/GraphQLClient.cs | 13 ++++++++++ .../GraphQLSubscriptionResult.cs | 24 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/GraphQL.Client/GraphQLSubscriptionResult.cs diff --git a/src/GraphQL.Client/GraphQLClient.cs b/src/GraphQL.Client/GraphQLClient.cs index 82b62f3c..ea21a826 100644 --- a/src/GraphQL.Client/GraphQLClient.cs +++ b/src/GraphQL.Client/GraphQLClient.cs @@ -157,6 +157,19 @@ public async Task PostAsync(GraphQLRequest request, Cancellatio } } + [Obsolete("EXPERIMENTAL API")] + public async Task SubscribeAsync(string query, CancellationToken cancellationToken = default) { + if (query == null) { throw new ArgumentNullException(nameof(query)); } + + return await this.SubscribeAsync(new GraphQLRequest { Query=query},cancellationToken).ConfigureAwait(false); + } + + [Obsolete("EXPERIMENTAL API")] + public async Task SubscribeAsync(GraphQLRequest request,CancellationToken cancellationToken = default) { + var a= new GraphQLSubscriptionResult(); + return a; + } + /// /// Releases unmanaged resources /// diff --git a/src/GraphQL.Client/GraphQLSubscriptionResult.cs b/src/GraphQL.Client/GraphQLSubscriptionResult.cs new file mode 100644 index 00000000..b764993a --- /dev/null +++ b/src/GraphQL.Client/GraphQLSubscriptionResult.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; +using GraphQL.Common.Response; + +namespace GraphQL.Client { + + /// + /// Represents the result of a subscription query + /// + [Obsolete("EXPERIMENTAL API")] + public class GraphQLSubscriptionResult { + + public event Action OnReceive; + + public GraphQLResponse LastResponse { get; } + + public GraphQLSubscriptionResult() { + this.OnReceive.Invoke(null); + } + + } + +} From 377ac4cf45cfdf44be530f6f6a88fb891be60263 Mon Sep 17 00:00:00 2001 From: Raul Hidalgo Caballero Date: Wed, 16 May 2018 16:43:11 +0200 Subject: [PATCH 2/3] . --- root.props | 2 +- src/GraphQL.Client/GraphQL.Client.csproj | 24 ++++++++++++------------ src/GraphQL.Client/GraphQLClient.cs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/root.props b/root.props index a424f271..4696cb93 100644 --- a/root.props +++ b/root.props @@ -8,7 +8,7 @@ True latest en-US - + CS1591 https://raw.githubusercontent.com/graphql-dotnet/graphql-client/master/assets/logo.64x64.png https://raw.githubusercontent.com/graphql-dotnet/graphql-client/master/LICENSE.txt https://github.com/graphql-dotnet/graphql-client diff --git a/src/GraphQL.Client/GraphQL.Client.csproj b/src/GraphQL.Client/GraphQL.Client.csproj index 5a48d488..bf5e45e0 100644 --- a/src/GraphQL.Client/GraphQL.Client.csproj +++ b/src/GraphQL.Client/GraphQL.Client.csproj @@ -1,22 +1,22 @@ - + - - A GraphQL Client - netstandard1.1;netstandard1.3;netstandard2.0 - + + A GraphQL Client + netstandard1.3;netstandard2.0 + - - - + + + - - - + + + -