Skip to content

Commit

Permalink
(docs) - propose way for thirth party exchanges
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jun 18, 2019
1 parent 7b2fc54 commit 267102d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ Everything about the basic & default `urql` behaviour
that comes with explanations of the `fetchExchange`,
the `cacheExchange`, and how to use _Subscriptions_.

### [Exchanges](exchanges.md)

Exchanges written by the community, these enhance
the behavior of your urql-client.

### [Extending & Experimenting](extending-and-experimenting.md)

Here's everything you need to know to extend,
Expand Down
22 changes: 22 additions & 0 deletions docs/exchanges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Exchanges

## Persisted Queries

[Repository](https://github.com/Daniel15/urql-persisted-queries)

Quoting from the repository:

Apollo Server implements Automatic Persisted Queries (APQ),
a technique that greatly improves network performance for GraphQL with
zero build-time configuration. A persisted query is a ID or hash that
can be sent to the server instead of the entire GraphQL query string.
This smaller signature reduces bandwidth utilization and speeds up client
loading times. Persisted queries are especially nice paired with GET requests,
enabling the browser cache and integration with a CDN.

With Automatic Persisted Queries, the ID is a deterministic hash of the input query,
so we don't need a complex build step to share the ID between clients and servers.
If a server doesn't know about a given hash, the client can expand the query for it.
Apollo Server caches that mapping.

Needless to say your server needs to support this.

0 comments on commit 267102d

Please sign in to comment.