Query Editor
Monaco-powered Gremlin editor with syntax highlighting, autocomplete, and multi-tab support.
Monaco Editor
GremlinStudio uses the same editor that powers VS Code — Monaco — customized for the Gremlin query language. This gives you a professional Gremlin query editor with the same editing experience found in modern IDEs, purpose-built for graph database development.
Syntax Highlighting
Gremlin keywords, step names, strings, numbers, and operators are color-coded so you can scan queries at a glance. The highlighting covers the full Gremlin vocabulary, making it easy to spot typos and structural errors before you run anything.
Autocomplete
The Gremlin IDE autocomplete in GremlinStudio goes beyond basic keyword matching. As you type, IntelliSense suggestions appear for:
- Gremlin step names — All standard traversal steps including
V(),E(),has(),hasLabel(),out(),in(),both(),outE(),inE(),values(),select(),project(),group(),fold(),unfold(),count(),limit(), and more. - Schema-aware labels — Once connected to a database, the editor suggests your actual vertex labels and property names drawn from the discovered schema. This eliminates guesswork and reduces errors from mistyped label names.
- Common traversal patterns — Frequently used Gremlin patterns are offered as completions, helping you build queries faster.
Trigger autocomplete manually at any time with Ctrl+Space.
Multi-Tab Editing
- Click + to open a new tab.
- Right-click a tab for options (close, close others, duplicate).
- Each tab maintains its own query text, results, and execution state, so you can run multiple queries in parallel and compare results across tabs.
Executing Queries
Write a Gremlin query in the editor and execute it:
- Ctrl+Enter — Execute the current query.
- Run Button — Click the play icon in the Query Toolbar.
Results appear in the result panel below the editor, with multiple views available including table, JSON, raw text, and interactive graph visualization.
Query Cancellation
Long-running queries can be stopped at any time. When a query is executing, the Run button swaps to a red Cancel button in the toolbar. You can cancel execution by:
- Pressing Escape on your keyboard.
- Clicking the red Cancel button in the toolbar.
Cancellation propagates from the frontend through SignalR to the backend, so the request is terminated as quickly as possible rather than simply being ignored on the client side.
Query Formatting
The built-in auto-formatter transforms long, single-line Gremlin chains into a readable multi-line format. Click the Format button in the toolbar or use Ctrl+Shift+F to reformat the current query. The formatter breaks chains at each step boundary, indenting continuation lines so the traversal structure is immediately visible. This is especially helpful when working with complex queries that chain dozens of steps together.
Query History
Every query you execute is automatically saved to history with its timestamp and connection context. Access your full history from the History button in the toolbar or the History panel in the sidebar. From there you can:
- Search and filter past queries by text content.
- Click to reload any previous query into the active editor tab.
- Review execution context to see when a query was run and against which connection.
History is persisted in the local SQLite database, so it survives application restarts.
Query Toolbar
The toolbar above the editor provides quick access to:
- Run / Cancel — Execute or cancel the current query.
- Debug — Start step-by-step debugging (Pro).
- Diff — Compare two queries side by side (Pro).
- NL Query — Open the AI natural language panel (Pro).
- Format — Auto-format your Gremlin query.
- History — Browse and reload previous queries.
Keyboard Shortcuts
GremlinStudio supports a full set of keyboard shortcuts for efficient editing:
| Shortcut | Action |
|---|---|
| Ctrl+Enter | Execute the current query |
| Escape | Cancel a running query |
| Ctrl+Shift+F | Format / auto-indent the query |
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+D | Select next occurrence of the current selection |
| Ctrl+/ | Toggle line comment |
| Ctrl+Shift+K | Delete the current line |
| Ctrl+Space | Trigger autocomplete suggestions |
Tips for Writing Gremlin
A few practices that make working with Gremlin queries in GremlinStudio more productive:
- Use
.limit()during exploration. When you are investigating an unfamiliar graph, append.limit(10)or.limit(100)to your traversals. This prevents accidentally pulling back millions of results and keeps response times fast while you learn the shape of the data. - Use
.profile()to see the execution plan. Appending.profile()to a traversal returns the step-by-step execution breakdown, showing how many traversers pass through each step. This is invaluable for understanding query performance and identifying bottlenecks. - Use
.executionProfile()for Cosmos DB RU cost analysis. If your graph is hosted on Azure Cosmos DB, the.executionProfile()step returns the Request Unit (RU) charge for the query. Monitoring RU consumption helps you optimize queries and control costs. - Break complex queries across lines. Use the Format button to keep long queries readable. A well-formatted query is easier to debug, share with teammates, and revisit later.
- Leverage autocomplete for accuracy. Let the Gremlin syntax highlighting and schema-aware autocomplete catch typos before execution. If a label or property name does not appear in the suggestions, double-check the Schema panel to confirm it exists in your database.