Execute mutations to create, modify, and delete resources with genuine persistence. Mutations are committed directly to your visitor sandbox overlay, immediately visible across subsequent GraphQL queries and REST endpoints.
Select an operational mutation preset below to load variables and execute state changes against your session:
How Playground API achieves 100% deterministic state mutation without database pollution:
Every request carries a cryptographic pg_identity cookie or header. Mutations are isolated to your sandbox UUID.
New records and field patches are stored as overlay deltas in Postgres. Base seed records remain intact for other developers.
Create a post in GraphQL, then fetch it via GET /api/v1/posts. State synchronizes across both protocols instantly.
Available mutation operations implemented in the Playground API GraphQL gateway:
| Mutation | Input Arguments | Return Type | Persistence Effect |
|---|---|---|---|
| createPost | title: String!, body: String, userId: ID | Post | Inserts post into session delta, assigns auto-increment ID. |
| updatePost | id: ID!, title: String, body: String | Post | Merges modifications over base seed or previously created post. |
| deletePost | id: ID! | Boolean | Marks post as tombstoned for the current session. |
| createComment | postId: ID!, name: String!, email: String!, body: String! | Comment | Creates comment attached to post and triggers subscription stream. |
| createTodo | title: String!, userId: ID, completed: Boolean | Todo | Inserts checklist item into user task list. |
| createUser | name: String!, username: String, email: String, phone: String | User | Creates user profile record with auto-generated avatar URL. |
Production patterns featuring optimistic updates, normalized cache synchronization, and server actions: