Relay Assistant
Query Editor AI
Fix errors and generate queries with AI directly in the query editor.
Fix with AI
When a query fails, Relay can use AI to suggest a fix. After an error occurs:
- Click the Fix with AI button that appears in the error banner
- Relay sends the failed query, error message, and your schema context to your configured AI provider
- A corrected query is suggested inline — you can Apply it directly or Copy it to clipboard
The fix is schema-aware, so it understands your table names, column types, and relationships.
Slash Prompts
Type / in the query editor to open the AI prompt input. This lets you describe what you want in plain language and have the AI generate a query for you.
Examples:
/find all users who signed up in the last 7 days/count orders by product category this month/create an index on the email column of the users table
The generated query replaces the slash prompt inline. You can review it before running.
How It Works
All query editor AI features use your database schema as context, including:
- Table and collection names
- Column names and types
- Foreign key relationships
- Indexes
This context is sent alongside your prompt to the AI provider so it can generate accurate, runnable queries for your specific database.