Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions docs/router/persisted-queries/persisted-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Persisted operations, also known as trusted documents, allow you t
icon: "database"
---

**Persisted operations** allow you to register queries / mutations / subscriptions within a federated graph, enabling the clients to send just an identifier in their request instead of sending the whole operation body. These operations need to be registered ahead of time, using the `wgc operation push` command.
**Persisted operations** allow you to register queries / mutations / subscriptions within a federated graph, enabling the clients to send just an identifier in their request instead of sending the whole operation body. These operations need to be registered ahead of time, using the `wgc operations push` command.

This not only saves bandwidth but can also help reduce the attack surface by allowing only safe-listed operations.

Expand Down Expand Up @@ -48,10 +48,27 @@ wgc operations push mygraph -n default -c my-client -f persisted-query-manifest.

Finally, you should enable persisted operations in your GraphQL client library.

To see all available options for `wgc operations push, see `[Push](/cli/operations/push).
To see all available options for `wgc operations push`, see [Push](/cli/operations/push).

Additionally, check the [Using Persisted Operation with Federated GraphQL](/tutorial/using-persisted-operations) tutorial for a step by step guide.
Comment thread
comatory marked this conversation as resolved.
Outdated

## Retiring persisted operations in Studio

You can retire persisted operations directly in Cosmo Studio after they have been uploaded via `wgc operations push`.

1. Open your federated graph in Studio.
2. Go to **Clients**.
3. Open a client and click **View Operations**.
4. Expand the operation and click the retire button (archive icon).
5. Confirm in the retire dialog.

Only organization users with `organization-admin` or `organization-developer` roles can retire operations.
Operations are currently retired one at a time from the UI.

<Note>
Studio always asks for confirmation before retiring operations. If traffic is detected for the selected operation, the dialog explicitly warns you that the operation is receiving traffic. If analytics data is unavailable, Studio warns that traffic cannot be guaranteed as zero.
</Note>

## Disallowing non-persisted Operations

If you're going all in on Security, you'd want to only allow Persisted Operations in your Production Environment.
Expand Down Expand Up @@ -116,4 +133,3 @@ To migrate from allowing all operations to a more restrictive option incremental

* **Compatibility with Automatic Persisted Queries (APQ)** The `safelist` option cannot be used alongside APQ, as their functions are opposite.
</Info>