graphql_search_api_query
This module provides GraphQL integration for Drupal's Search API, allowing you to perform search queries through GraphQL with the same functionality as the core graphql_core_schema entity query but operating on Search API indexes instead of directly on entities.
Features
This module bridges Drupal's Search API with GraphQL, providing developers building headless or decoupled Drupal sites with powerful search capabilities. The basic functionality includes:
- GraphQL Search Queries: Execute search queries through GraphQL using the same syntax as core entity queries
- Full-text Search: Perform keyword searches across indexed content with relevance scoring
- Advanced Filtering: Apply complex filters with support for all Search API operators (equals, contains, between, etc.)
- Faceted Search: Generate facets for any indexed field to enable filtered browsing experiences
- Sorting & Pagination: Sort results by any field and implement pagination with limit/offset
- Multilingual Support: Automatic language filtering and content translation
- Grouping of results: Allows results to be grouped by given facets.
Post-Installation
After installation, the module automatically extends your GraphQL schema with a new `searchApiQuery` field. Here's how to get started:
1. Configure Search API Index: Ensure you have a Search API index configured with the fields you want to search and facet on
2. Enable GraphQL Schema: The module works with the `core_composable` GraphQL schema from graphql_core_schema
3. Test Queries: Use GraphQL Explorer or GraphiQL to test your search queries
No additional configuration pages are needed - the module works out of the box once your Search API indexes are properly configured. The GraphQL endpoint will immediately have access to the new search capabilities.