From ec0efe26ff1cf915e472d0491e402ddc58dcbbc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=20Houl=C3=A9?= <tom@tomhoule.com>
Date: Sat, 15 Feb 2025 17:43:50 +0000
Subject: [PATCH] readme: document graphql-ws-client as solution for runtime
 subscriptions

closes https://github.com/graphql-rust/graphql-client/issues/448
---
 Cargo.lock | 75 +++++++-----------------------------------------------
 README.md  |  8 +++++-
 2 files changed, 16 insertions(+), 67 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 461021eb..d7ba93aa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -88,17 +88,6 @@ version = "1.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
 
-[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi 0.1.19",
- "libc",
- "winapi",
-]
-
 [[package]]
 name = "autocfg"
 version = "1.4.0"
@@ -311,42 +300,19 @@ dependencies = [
  "cfg-if",
 ]
 
-[[package]]
-name = "env_filter"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0"
-dependencies = [
- "log",
- "regex",
-]
-
 [[package]]
 name = "env_logger"
-version = "0.5.13"
+version = "0.10.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
+checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
 dependencies = [
- "atty",
- "humantime 1.3.0",
+ "humantime",
+ "is-terminal",
  "log",
  "regex",
  "termcolor",
 ]
 
-[[package]]
-name = "env_logger"
-version = "0.11.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0"
-dependencies = [
- "anstream",
- "anstyle",
- "env_filter",
- "humantime 2.1.0",
- "log",
-]
-
 [[package]]
 name = "equivalent"
 version = "1.0.1"
@@ -511,8 +477,9 @@ dependencies = [
 name = "graphql_client_cli"
 version = "0.14.0"
 dependencies = [
+ "anstyle",
  "clap",
- "env_logger 0.11.6",
+ "env_logger",
  "graphql_client",
  "graphql_client_codegen",
  "log",
@@ -552,7 +519,7 @@ version = "0.1.0"
 dependencies = [
  "anyhow",
  "clap",
- "env_logger 0.5.13",
+ "env_logger",
  "graphql_client",
  "log",
  "prettytable-rs",
@@ -564,7 +531,7 @@ name = "graphql_query_hasura_example"
 version = "0.1.0"
 dependencies = [
  "anyhow",
- "env_logger 0.5.13",
+ "env_logger",
  "graphql_client",
  "log",
  "prettytable-rs",
@@ -603,15 +570,6 @@ version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
 
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
 [[package]]
 name = "hermit-abi"
 version = "0.4.0"
@@ -658,15 +616,6 @@ version = "1.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a"
 
-[[package]]
-name = "humantime"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
-dependencies = [
- "quick-error",
-]
-
 [[package]]
 name = "humantime"
 version = "2.1.0"
@@ -907,7 +856,7 @@ version = "0.4.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37"
 dependencies = [
- "hermit-abi 0.4.0",
+ "hermit-abi",
  "libc",
  "windows-sys 0.59.0",
 ]
@@ -1138,12 +1087,6 @@ dependencies = [
  "unicode-ident",
 ]
 
-[[package]]
-name = "quick-error"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-
 [[package]]
 name = "quinn"
 version = "0.11.6"
diff --git a/README.md b/README.md
index 7b86a93c..98c6c538 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ A typed GraphQL client library for Rust.
 - Precise types for query variables and responses.
 - Supports GraphQL fragments, objects, unions, inputs, enums, custom scalars and input objects.
 - Works in the browser (WebAssembly).
-- Subscriptions support (serialization-deserialization only at the moment).
+- Subscriptions support.
 - Copies documentation from the GraphQL schema to the generated Rust code.
 - Arbitrary derives on the generated responses.
 - Arbitrary custom scalars.
@@ -185,6 +185,12 @@ pub struct Heights;
 
 There is an example [in the tests](./graphql_client/tests/operation_selection).
 
+## Subscriptions
+
+The subscription variable and response shapes are handled by code generation the same way as for other operation types.
+
+For the runtime part of the story, we recommend the awesome [graphql-ws-client](https://crates.io/crates/graphql-ws-client) by @obmarg.
+
 ## Documentation for the generated modules
 
 You can use `cargo doc --document-private-items` to generate rustdoc documentation on the generated code.