Skip to content

GraphQL Editor & Templates

The Query Editor is a Monaco-powered GraphQL interface with intelligent, schema-aware templates that adapt to your collection's actual schema.

Features

  • Monaco Editor with full GraphQL syntax highlighting
  • Schema-aware autocompletion based on your connected Weaviate instance
  • 12+ query templates covering all major Weaviate operations
  • Real-time validation and error highlighting
  • Dynamic template generation that auto-populates properties from your schema

Query Templates

Choose the right template for your use case:

TemplateUse Case
Basic GetSimple object retrieval
Vector Search (nearVector)Similarity search with explicit vector
Semantic Search (nearText)Concept-driven search with AI embeddings
Object Search (nearObject)Find similar to existing object
Hybrid SearchBM25 + Vector with alpha balancing
BM25 SearchKeyword-based retrieval
Generative SearchRAG with AI-generated summaries
Filter QueryComplex WHERE conditions
Aggregation QueryStatistics (count, min, max, mean)
Group By QueryAggregate by property categories
Relationship QueryExplore cross-references
Explore QueryMetadata, vectors, and per-object generation
Tenant QueryMulti-tenant data access

Schema-Aware Generation

When your schema is available, dynamic templates:

  • Auto-populate primitive properties (text, number, boolean, date)
  • Include geo-coordinates with latitude/longitude selection
  • Keep cross-reference selections minimal (inline fragment with _additional.id)
  • Tailor generative prompts to available text properties
  • Detect embedding model dimensions for 15+ popular models

Configuration

Customize template generation via QueryConfig:

FieldPurpose
limitResult limit (default: 10)
offsetPagination offset
includeVectorsInclude object vectors
includeMetadataInclude creation/update timestamps
includeScoresInclude distance/certainty/score
maxPropertiesCap displayed properties
tenantNameMulti-tenant target
searchQueryBM25/hybrid query text
conceptsnearText concepts
alphaHybrid balance (0=vector, 1=keyword)

Distance vs. Certainty

  • distance (preferred in v1.14+): Lower = closer. Threshold acts as maximum.
  • certainty (legacy): 0–1 range; higher is stricter.

Supported Embedding Models

The template system detects dimensions for 15+ models:

  • OpenAI (ada-002: 1536, text-embedding-3-small: 1536, text-embedding-3-large: 3072)
  • Cohere v3: 1024
  • Sentence Transformers (mpnet): 768
  • BERT, PaLM, Ollama, AWS Bedrock, and more

TIP

For a comprehensive guide covering all templates, best practices, and a troubleshooting FAQ with 41 common mistakes, see the full GraphQL Templates Guide.

Released under the MIT License.