Schema Support
The Laboratory provides comprehensive schema support through automatic introspection and a visual Builder that helps you explore and build GraphQL operations.
Schema Introspection
The Laboratory automatically introspects your GraphQL schema when you provide an endpoint. This enables:
- Auto-completion - The editor suggests available fields, types, and arguments
- Validation - Real-time checking of your queries against the schema
- Type information - See field types, required arguments, and descriptions
- Builder - Visual exploration of your entire schema
Setting Your Endpoint
Default Endpoint
If your Laboratory is configured with a default endpoint, it will be automatically loaded. You can restore the default endpoint at any time using the restore button in the Builder panel.
Custom Endpoint
To use a different endpoint:
- Open the Builder panel (left side of the Laboratory)
- Enter your GraphQL endpoint URL in the endpoint input field
- The Laboratory will automatically fetch the schema via introspection
The endpoint can be:
- A standard HTTP/HTTPS GraphQL endpoint
- A GraphQL endpoint with custom path (e.g.,
/graphql,/api/graphql) - Any endpoint that supports GraphQL introspection
Refreshing the Schema
If your schema changes, you can refresh it:
- Open the Command Palette (
⌘J) - Select “Refetch schema”
- Or use the refresh button in the Builder panel
The Builder
The Builder provides a visual way to explore your schema and construct operations.
Schema Navigation
The Builder organizes your schema into three main sections:
- Query - All query operations available in your schema
- Mutation - All mutation operations
- Subscription - All subscription operations
Each section shows all available fields with their types and arguments.
Building Operations Visually
To build an operation using the Builder:
- Select a root field - Click on a query, mutation, or subscription field
- Choose nested fields - Expand object types to select nested fields
- Add arguments - Check arguments you want to include
- Watch it build - The query is automatically generated in the editor
Field Types
The Builder displays different icons for different field types:
- Scalar fields - Simple types like
String,Int,Boolean - Object fields - Complex types that can be expanded
- List fields - Arrays indicated by
[Type] - Required fields - Marked with
!(non-nullable)
Arguments
When a field has arguments:
- Expand the
[arguments]section - Check the arguments you want to include
- Arguments are automatically added to your query with placeholder values
- Fill in the actual values in the Variables tab
Collapsing and Expanding
- Expand all - Click on fields to expand and see nested types
- Collapse all - Use the collapse button to close all expanded sections
- Auto-expand - Fields used in your current query are automatically expanded
Schema-Aware Editor
The operation editor uses your schema to provide:
Auto-completion
As you type, the editor suggests:
- Field names
- Argument names
- Type names
- Enum values
Press Tab or Enter to accept suggestions.
Validation
The editor validates your query in real-time:
- Red underlines - Syntax errors
- Yellow underlines - Schema validation errors
- Hover for details - See specific error messages
Type Information
Hover over any field or type to see:
- Field type
- Description (if available)
- Required arguments
- Deprecation status
Working Without a Schema
If you don’t have a schema available, you can still:
- Write operations manually
- Use the editor without auto-completion
- Execute operations against any endpoint
However, you won’t have access to:
- Visual Builder
- Auto-completion
- Schema validation
- Type information
Schema Caching
The Laboratory caches your schema to improve performance:
- Fast loading - Previously introspected schemas load instantly
- Automatic refresh - Schema is refreshed when you change endpoints
- Manual refresh - Use Command Palette to force a refresh
Best Practices
- Use the Builder for exploration - Great for discovering available fields and types
- Combine Builder and editor - Start with Builder, then fine-tune in the editor
- Keep schema updated - Refresh when your API schema changes
- Check types - Hover over fields to understand their types before using them
- Validate early - Use schema validation to catch errors before execution
Troubleshooting
Schema Not Loading
If your schema doesn’t load:
- Check endpoint - Verify the endpoint URL is correct
- Check CORS - Ensure your server allows introspection requests
- Check authentication - Some endpoints require authentication for introspection
- Check network - Verify you can reach the endpoint
Schema Out of Date
If your schema seems outdated:
- Use “Refetch schema” from the Command Palette
- Change and restore your endpoint
- Refresh the page
Missing Fields
If fields don’t appear in the Builder:
- Check if you’re looking in the correct tab (Query/Mutation/Subscription)
- Verify the field exists in your schema
- Refresh the schema
- Some fields may be hidden based on permissions or schema configuration