> ## Documentation Index
> Fetch the complete documentation index at: https://cosmo-docs.wundergraph.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

> Save operations you want to come back to, keep them private or share them with everyone who can see the graph, and open them straight into a Playground tab.

A collection is a named group of saved operations that belongs to one federated graph. Open the Collections panel from the icon in the Playground's left sidebar.

![Collections panel in the Cosmo Playground, with the Collections icon in the left sidebar highlighted](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/panel.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=769433a4feb7b17f0d62fd63e2ee7879)

The Collections panel

Each saved operation stores the query document and its variables. Headers are not stored. Use [default headers](/studio/playground/default-headers.md) for values that every tab needs.

## Private and team collections

Every collection is one of two kinds, chosen when you create it.

| | **Private** | **Team** |
| :- | :- | :- |
| Who can see it | Only you | Everyone who can view the graph |
| Who can change it | Only you | Everyone who can edit the graph |
| Can the scope change | Can be shared with the team later | Cannot be made private again |

Collections are grouped by scope in the panel, private first.

Creating a team collection requires write access to the graph. Without it, the scope choice is not offered and every collection you create is private.

## Creating a collection

**1. Click the + button in the Collections panel header**

The New collection dialog opens.

**2. Give the collection a name**

Names are up to 100 characters and do not have to be unique.

**3. Choose who can see it**

Private keeps it to yourself. Team shares it with everyone who can see the graph, and cannot be undone.

**4. Click Create**

The collection appears in the panel under its group.

![New collection dialog, opened from the highlighted plus button in the panel header](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/new-collection-dialog.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=5c704f2ae1bd9d026c395a6bad02af99)

Creating a collection

## Saving an operation

Write a query in the Playground, then open the save menu in the editor toolbar.

![Playground editor toolbar save menu, with the highlighted save button that opens it](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/save-menu.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=fe5b532c04ac8ba237eb4fe2cbb2dd39)

The save menu in the editor toolbar

The menu offers up to three actions:

* **Save** updates the operation the current tab is already bound to. It only appears once the tab holds a saved operation.
* **Save to collection** (or **Save as** when the tab is already bound) creates a new saved operation.
* **Persist operation** is unrelated to collections. See [persisted operations](/router/persisted-queries.md).

Choosing **Save to collection** opens a dialog where you pick the collection and name the operation. The name defaults to the operation name in the document, and the picker lists only collections you can write to.

![Save operation dialog with a collection picker and a name field](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/save-operation-dialog.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=5b25c279d707bc359f9b4a6856a53149)

Saving an operation into a collection

A document must be syntactically valid GraphQL to be saved, and variables must be valid JSON. The document is not checked against the schema, so an operation that references a field the graph no longer has still saves and still opens. Queries and variables are limited to 100,000 characters each.

## When someone else saved first

Team collections can be edited by anyone with write access to the graph, so two people can edit the same operation at once. Saving checks the version you opened against the stored one. If they differ, the save is refused and nothing is overwritten.

![Dialog reporting that the operation changed while you were editing it](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/save-conflict-dialog.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=ee3563877b538d99001f3bd8957b9796)

A concurrent edit was detected

Nothing is merged automatically. You choose:

* **Save as a new operation** keeps your work under a new name and leaves theirs untouched.
* **Discard mine and reload** replaces your editor with the stored version.

## Sharing a collection with the team

Open the collection's menu and choose **Share with team**. Everyone who can view the graph will see the collection, and everyone who can edit the graph will be able to change its operations.

![Dialog confirming that a collection will be shared with the team](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/share-dialog.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=49a9d15afd0a367c2c4554f3740da2e5)

Sharing a private collection

Sharing cannot be undone. A shared collection cannot be made private again.

## Finding an operation

Search filters collections and their operations by name as you type. A collection whose own name matches keeps all of its operations. A collection matched only through an operation shows just the operations that matched.

![Collections panel filtered by a search term, with the highlighted search box](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/search.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=2c806e13d75c7a9a82db413141f482e1)

Searching by operation name

The button next to the search box sorts the list by **Name** or by **Date created**, newest first. The choice applies to both groups.

![Sort menu offering Name and Date created, with the highlighted button that opens it](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/sort-menu.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=9adaa57cb7aabc2e1608f6dceb398ed5)

Sorting the list

## Linking to a collection or an operation

**Copy link** in a collection's or an operation's menu copies a URL that points at it. Opening that link selects the Collections panel, expands the collection, and opens the operation.

The link carries only the collection and operation identifiers, not the contents of your editor, so it stays short and does not leak the tab you happen to have open.

Whoever opens the link still needs access. A link to a private collection, or to a collection on a graph they cannot view, shows a short notice that the collection is unavailable rather than revealing that it exists.

## Renaming and deleting

Both collections and operations have **Rename** and **Delete** in their menus.

* Renaming an operation changes its label in the panel. It does not change the operation name inside the document.
* Deleting a collection deletes the operations inside it. The confirmation says how many will go with it, and whether the collection is shared with your team.

![Confirmation dialog for deleting a collection, listing how many operations go with it](https://mintcdn.com/wundergraphinc/yn9VjJAzZrYv3-n_/images/studio/collections/delete-dialog.png?fit=max\&auto=format\&n=yn9VjJAzZrYv3-n_\&q=85\&s=f34fc9bf394256183cb7583afce75281)

Deleting a collection that holds operations

Deleting is permanent.

## Permissions

| Action | Required |
| :- | :- |
| See team collections | Read access to the graph |
| See a private collection | Being its owner |
| Create a private collection | Read access to the graph |
| Create a team collection | Write access to the graph |
| Edit or delete a team collection, or its operations | Write access to the graph |
| Edit or delete a private collection, or its operations | Being its owner |
| Share a private collection with the team | Being its owner, and write access to the graph |

Actions you cannot perform are not shown. A read-only member sees team collections and can open their operations, but gets no save, rename, share or delete controls.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.