|
1
|
{"slug":"/references/modules_sdk/classes/modules_sdk.Query","title":"Query","frontmatter":{},"toc":[{"title":"constructor","id":"constructor","level":2},{"title":"Parameters","id":"constructor-parameters","level":3},{"title":"Properties","id":"properties","level":2},{"title":"Methods","id":"methods","level":2},{"title":"query","id":"query","level":3},{"title":"Parameters","id":"query-parameters","level":4},{"title":"Returns","id":"query-returns","level":4},{"title":"gql","id":"gql","level":3},{"title":"Parameters","id":"gql-parameters","level":4},{"title":"Returns","id":"gql-returns","level":4},{"title":"graph","id":"graph","level":3},{"title":"Type Parameters","id":"graph-type-parameters","level":4},{"title":"Parameters","id":"graph-parameters","level":4},{"title":"Returns","id":"graph-returns","level":4},{"title":"search","id":"search","level":3},{"title":"Type Parameters","id":"search-type-parameters","level":4},{"title":"Parameters","id":"search-parameters","level":4},{"title":"Returns","id":"search-returns","level":4},{"title":"Type Parameters","id":"search-type-parameters-1","level":4},{"title":"Parameters","id":"search-parameters-1","level":4},{"title":"Returns","id":"search-returns-1","level":4},{"title":"index","id":"index","level":3},{"title":"Type Parameters","id":"index-type-parameters","level":4},{"title":"Parameters","id":"index-parameters","level":4},{"title":"Returns","id":"index-returns","level":4}],"blocks":[{"kind":"markdown","html":"Public query API for Medusa's cross-module graph query system.\n\nAccepts several input shapes (graph config, legacy string config, GraphQL,\nor a pre-built [RemoteJoinerQuery](/references/types/interfaces/types.RemoteJoinerQuery)), normalizes them via\nnormalizeQuery, and delegates execution to [RemoteJoiner](/references/modules_sdk/classes/modules_sdk.RemoteJoiner).\n\n[RemoteJoiner](/references/modules_sdk/classes/modules_sdk.RemoteJoiner) resolves relationships from module joiner configs,\nplans nested expands, and loads data through ModuleDataFetcher\n(IRemoteDataFetcher). This class adds response shaping, caching,\nlocale translation, and index-assisted querying on top of that pipeline.\n\n```\nuser input → normalizeQuery() → RemoteJoiner.query() → ModuleDataFetcher.fetch()\n```"},{"kind":"heading","level":2,"text":"constructor","id":"constructor"},{"kind":"heading","level":3,"text":"Parameters","id":"constructor-parameters"},{"kind":"typeList","sectionTitle":"constructor","types":[{"name":"__namedParameters","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"remoteJoiner","type":"[RemoteJoiner](/references/modules_sdk/classes/modules_sdk.RemoteJoiner)","description":"Executes cross-module graph queries by resolving relationships from module\njoiner configs.\n\nPipeline: \n\nGraphCatalog\n\n (index configs) → \n\ncompileQuery\n\n\n(query → plan) → \n\nexecutePlan\n\n (fetch + join + shortcuts).\n\nData loading is delegated to \n\nIRemoteDataFetcher\n\n (typically\nModuleDataFetcher). Query is the public entry point that normalizes user\ninput and invokes \n\nRemoteJoiner.query\n\n.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"joinerConfigs","type":"[ModuleJoinerConfig](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g { product\\_id: \"Product\" } \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"indexModule","type":"[IIndexService](/references/types/IndexTypes/interfaces/types.IndexTypes.IIndexService)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"searchModule","type":"[ISearchModuleService](/references/types/SearchTypes/interfaces/types.SearchTypes.ISearchModuleService)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](/references/medusa/types/medusa.MedusaContainer)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":2,"text":"Properties","id":"properties"},{"kind":"typeList","sectionTitle":"Query","types":[{"name":"container","type":"[MedusaContainer](/references/medusa/types/medusa.MedusaContainer)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"traceGraphQuery","type":"(`queryFn`: () => Promise<any>, `queryOptions`: ``{ entity: never ; fields: string[] ; pagination?: { skip?: number ; take?: number ; order?: undefined } ; filters?: undefined ; context?: [QueryContextType](/references/types/CommonTypes/types/types.CommonTypes.QueryContextType) ; withDeleted?: boolean ; strategy?: \"joined\" \\| \"select-in\" \\| \"balanced\" }`` \\| ``{ entity: any ; fields: string[] ; pagination?: { skip?: number ; take?: number ; order?: Record<string, any> \\| {} } ; filters?: [RemoteQueryFilters](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFilters)<any> ; context?: [QueryContextType](/references/types/CommonTypes/types/types.CommonTypes.QueryContextType) ; withDeleted?: boolean ; strategy?: \"joined\" \\| \"select-in\" \\| \"balanced\" }``) => Promise<any>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"traceRemoteQuery","type":"(`queryFn`: () => Promise<any>, `queryOptions`: [RemoteJoinerQuery](/references/types/interfaces/types.RemoteJoinerQuery) \\| [RemoteQueryObjectConfig](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryObjectConfig)<any> \\| [RemoteQueryObjectFromStringResult](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryObjectFromStringResult)<any>) => Promise<any>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"instrument","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":2,"text":"Methods","id":"methods"},{"kind":"heading","level":3,"text":"query","id":"query"},{"kind":"heading","level":4,"text":"Parameters","id":"query-parameters"},{"kind":"typeList","sectionTitle":"query","types":[{"name":"queryOptions","type":"[RemoteJoinerQuery](/references/types/interfaces/types.RemoteJoinerQuery) \\| `object` \\| `object` \\| [RemoteQueryObjectConfig](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryObjectConfig)<any> \\| [RemoteQueryObjectFromStringResult](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryObjectFromStringResult)<any>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"`string`","description":"The name of the service to query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"The alias of the service entry point to query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"expands","type":"`object`[]","description":"Nested relationships to expand in the query result.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"property","type":"`string`","description":"The property path to the relationship to expand.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`[]","description":"The fields to retrieve for the expanded relationship.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"[JoinerArgument](/references/types/interfaces/types.JoinerArgument)[]","description":"Arguments to pass to the expanded relationship query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"directives","type":"`object`","description":"Directives to apply to fields in the expanded relationship.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"fields","type":"`string`[]","description":"The fields to retrieve from the queried service.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"[JoinerArgument](/references/types/interfaces/types.JoinerArgument)[]","description":"Arguments to pass to the service query.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the argument.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`any`","description":"The value of the argument.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"directives","type":"`object`","description":"Directives to apply to fields in the query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"entity","type":"`never`","description":"The name of the entity to retrieve. For example, `product`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"pagination","type":"`object`","description":"Pagination configurations for the returned list of items.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"skip","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`number`","description":"The maximum number of items to return.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`undefined`","description":"Sort by field names in ascending or descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"filters","type":"`undefined`","description":"Filters to apply on the retrieved items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[QueryContextType](/references/types/CommonTypes/types/types.CommonTypes.QueryContextType)","description":"Apply a query context on the retrieved data. For example, to retrieve product prices for a certain context.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"Apply a `withDeleted` flag on the retrieved data to retrieve soft deleted items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"strategy","type":"`\"joined\"` \\| `\"select-in\"` \\| `\"balanced\"`","description":"Strategy will be send to the entry module called method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"entryPoint","type":"TEntry \\| keyof [RemoteQueryEntryPoints](/references/types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variables","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__TConfig","type":"TConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__value","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"query-returns"},{"kind":"typeList","sectionTitle":"query","types":[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":3,"text":"gql","id":"gql"},{"kind":"heading","level":4,"text":"Parameters","id":"gql-parameters"},{"kind":"typeList","sectionTitle":"gql","types":[{"name":"query","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variables","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"gql-returns"},{"kind":"typeList","sectionTitle":"gql","types":[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":3,"text":"graph","id":"graph"},{"kind":"heading","level":4,"text":"Type Parameters","id":"graph-type-parameters"},{"kind":"typeList","sectionTitle":"graph","types":[{"name":"TEntry","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":4,"text":"Parameters","id":"graph-parameters"},{"kind":"typeList","sectionTitle":"graph","types":[{"name":"queryOptions","type":"[RemoteQueryInput](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryInput)<TEntry>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"graph-returns"},{"kind":"typeList","sectionTitle":"graph","types":[{"name":"Promise","type":"Promise<[GraphResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet)<TEntry>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]},{"kind":"heading","level":3,"text":"search","id":"search"},{"kind":"markdown","html":"`**search**<TypeParameter TEntry>(queryOptions, options?): Promise<[SearchResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.SearchResultSet)<TEntry>[]>`\n"},{"kind":"markdown","html":"Runs a search and expands the hits with `query.graph`.\n\nThe engine only holds what its index was defined with, so the requested\nfields are split: what the index can return comes back from the search, and\nthe rest is fetched by id. Search order is preserved through the expand.\n\nPass an array to run several queries in one provider round-trip — InstantSearch\nextra facet requests, or `disjunctive_facets` expansion, go through this path."},{"kind":"heading","level":4,"text":"Type Parameters","id":"search-type-parameters"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"TEntry","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":4,"text":"Parameters","id":"search-parameters"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"queryOptions","type":"[SearchQuery](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchQuery)<TEntry>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"entity","type":"TEntry","description":"The name of the index to query, which defaults to the index whose name\nequals the entity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`[]","description":"The dotted paths of the fields the search engine should return. Only fields\navailable in the search engine can be passed here.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)","description":"The filters to apply, including the free-text query as `q`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)[]","description":"Filters that must all match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)[]","description":"Filters of which at least one must match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)","description":"Filters that must not match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"The free-text query. Sits among the filters so a `query.graph` call converts\nto `query.search` unchanged; the module lifts it out before compiling the\nrest, so a provider never sees `q` as a field.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"pagination","type":"[SearchPagination](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchPagination)","description":"How the results are paginated and sorted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"skip","type":"`number`","description":"The number of documents to skip before the returned hits. Mutually exclusive\nwith `cursor`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`number`","description":"The maximum number of hits to return.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`Record<string, [SearchOrderBy](/references/types/SearchTypes/types/types.SearchTypes.SearchOrderBy)>`","description":"The fields to sort the hits by, keyed by the field's dotted path. The\nreserved `_score` key sorts by relevance.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cursor","type":"`string`","description":"An opaque provider cursor, as returned in a previous result's\n`metadata.next_cursor`. Mutually exclusive with `skip`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"search_options","type":"[SearchOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchOptions)","description":"The options changing how the query is matched, scored, and aggregated.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attributes_to_search_on","type":"`string`[]","description":"The dotted paths of the fields to match the free-text query against. Defaults\nto every field marked `searchable` on the index.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"match_strategy","type":"[SearchMatchStrategy](/references/types/SearchTypes/types/types.SearchTypes.SearchMatchStrategy)","description":"How query terms combine.\n\n- `\"all\"` (default): every term must appear as a complete token.\n- `\"any\"`: at least one term must match.\n- `\"last\"`: typeahead. Completed terms must match in full; the last term\n is a prefix, so `\"my sear\"` matches `\"My search results\"`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"typo_tolerance","type":"`boolean`","description":"Whether to match terms that are misspelled by a character or two.\nit is ignored unless the query includes a free-text `q` and the\nsearched fields have typo tolerance enabled in the index's `settings.typo_tolerance`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"facets","type":"(`string` \\| [SearchFacetRequest](/references/types/SearchTypes/types/types.SearchTypes.SearchFacetRequest))[]","description":"The facets to compute alongside the hits. A string is shorthand for a `value`\nfacet on that field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disjunctive_facets","type":"`boolean`","description":"Compute each facet ignoring the filter on that same field, so a storefront\nkeeps showing sibling values of an active filter. Needs one query per facet\non every engine reviewed, so the module expands them and hands the set to\n`provider.searchMany`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"highlight","type":"`boolean` \\| [SearchHighlightOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchHighlightOptions)","description":"How the matched terms are highlighted in the returned hits. Applied only\nwhen the query includes a free-text `q`; otherwise it is ignored.\n\n`true` highlights every field the query searches on. Pass an object to pick\nfields, tags, or snippet cropping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"distinct","type":"`string`","description":"Return at most one hit per distinct value of this field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_score","type":"`number`","description":"Discard hits scoring below this threshold.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"include_score","type":"`boolean`","description":"Whether to return each hit's relevance score.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locales","type":"`string`[]","description":"Query-time language hint, e.g. `[\"en\"]`. Engines that analyze per language\n(Meilisearch, Algolia) use it to pick the analyzer; a provider that cannot\nhonour it rejects it rather than silently matching differently. Neither\nfirst-party provider does: configure the analyzer language on the provider\n(postgres) or on the field (Medusa) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"vector","type":"[SearchVectorOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchVectorOptions)","description":"The options of a vector, or semantic, search to run instead of, or alongside,\nthe free-text query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"[SearchCountStrategy](/references/types/SearchTypes/types/types.SearchTypes.SearchCountStrategy)","description":"How the total number of matching documents is computed. `\"exact\"` may be\nrejected or slow depending on the provider.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_options","type":"`Record<string, Record<string, unknown>>`","description":"Escape hatch for engine features the interface does not model, keyed by\nprovider identifier, e.g. `{ typesense: { drop_tokens_threshold: 0 } }`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[QueryContextType](/references/types/CommonTypes/types/types.CommonTypes.QueryContextType)","description":"The context passed to the `query.graph` call during hydration.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"search-returns"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"Promise","type":"Promise<[SearchResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.SearchResultSet)<TEntry>[]>","optional":false,"defaultValue":"","description":"Runs a search and expands the hits with `query.graph`.\n\nThe engine only holds what its index was defined with, so the requested\nfields are split: what the index can return comes back from the search, and\nthe rest is fetched by id. Search order is preserved through the expand.\n\nPass an array to run several queries in one provider round-trip — InstantSearch\nextra facet requests, or `disjunctive_facets` expansion, go through this path.","expandable":false,"children":[{"name":"SearchResultSet<TEntry>[]","type":"[SearchResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.SearchResultSet)<TEntry>[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]},{"kind":"markdown","html":"`**search**<TypeParameter TEntry>(queryOptions, options?): Promise<[SearchResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.SearchResultSet)<TEntry>>`\n"},{"kind":"markdown","html":"Runs a search and expands the hits with `query.graph`.\n\nThe engine only holds what its index was defined with, so the requested\nfields are split: what the index can return comes back from the search, and\nthe rest is fetched by id. Search order is preserved through the expand.\n\nPass an array to run several queries in one provider round-trip — InstantSearch\nextra facet requests, or `disjunctive_facets` expansion, go through this path."},{"kind":"heading","level":4,"text":"Type Parameters","id":"search-type-parameters-1"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"TEntry","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":4,"text":"Parameters","id":"search-parameters-1"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"queryOptions","type":"[SearchQuery](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchQuery)<TEntry>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"entity","type":"TEntry","description":"The name of the index to query, which defaults to the index whose name\nequals the entity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`[]","description":"The dotted paths of the fields the search engine should return. Only fields\navailable in the search engine can be passed here.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)","description":"The filters to apply, including the free-text query as `q`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)[]","description":"Filters that must all match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)[]","description":"Filters of which at least one must match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[SearchFilters](/references/types/SearchTypes/types/types.SearchTypes.SearchFilters)","description":"Filters that must not match.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"The free-text query. Sits among the filters so a `query.graph` call converts\nto `query.search` unchanged; the module lifts it out before compiling the\nrest, so a provider never sees `q` as a field.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"pagination","type":"[SearchPagination](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchPagination)","description":"How the results are paginated and sorted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"skip","type":"`number`","description":"The number of documents to skip before the returned hits. Mutually exclusive\nwith `cursor`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`number`","description":"The maximum number of hits to return.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`Record<string, [SearchOrderBy](/references/types/SearchTypes/types/types.SearchTypes.SearchOrderBy)>`","description":"The fields to sort the hits by, keyed by the field's dotted path. The\nreserved `_score` key sorts by relevance.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cursor","type":"`string`","description":"An opaque provider cursor, as returned in a previous result's\n`metadata.next_cursor`. Mutually exclusive with `skip`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"search_options","type":"[SearchOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchOptions)","description":"The options changing how the query is matched, scored, and aggregated.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attributes_to_search_on","type":"`string`[]","description":"The dotted paths of the fields to match the free-text query against. Defaults\nto every field marked `searchable` on the index.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"match_strategy","type":"[SearchMatchStrategy](/references/types/SearchTypes/types/types.SearchTypes.SearchMatchStrategy)","description":"How query terms combine.\n\n- `\"all\"` (default): every term must appear as a complete token.\n- `\"any\"`: at least one term must match.\n- `\"last\"`: typeahead. Completed terms must match in full; the last term\n is a prefix, so `\"my sear\"` matches `\"My search results\"`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"typo_tolerance","type":"`boolean`","description":"Whether to match terms that are misspelled by a character or two.\nit is ignored unless the query includes a free-text `q` and the\nsearched fields have typo tolerance enabled in the index's `settings.typo_tolerance`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"facets","type":"(`string` \\| [SearchFacetRequest](/references/types/SearchTypes/types/types.SearchTypes.SearchFacetRequest))[]","description":"The facets to compute alongside the hits. A string is shorthand for a `value`\nfacet on that field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disjunctive_facets","type":"`boolean`","description":"Compute each facet ignoring the filter on that same field, so a storefront\nkeeps showing sibling values of an active filter. Needs one query per facet\non every engine reviewed, so the module expands them and hands the set to\n`provider.searchMany`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"highlight","type":"`boolean` \\| [SearchHighlightOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchHighlightOptions)","description":"How the matched terms are highlighted in the returned hits. Applied only\nwhen the query includes a free-text `q`; otherwise it is ignored.\n\n`true` highlights every field the query searches on. Pass an object to pick\nfields, tags, or snippet cropping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"distinct","type":"`string`","description":"Return at most one hit per distinct value of this field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_score","type":"`number`","description":"Discard hits scoring below this threshold.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"include_score","type":"`boolean`","description":"Whether to return each hit's relevance score.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locales","type":"`string`[]","description":"Query-time language hint, e.g. `[\"en\"]`. Engines that analyze per language\n(Meilisearch, Algolia) use it to pick the analyzer; a provider that cannot\nhonour it rejects it rather than silently matching differently. Neither\nfirst-party provider does: configure the analyzer language on the provider\n(postgres) or on the field (Medusa) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"vector","type":"[SearchVectorOptions](/references/types/SearchTypes/interfaces/types.SearchTypes.SearchVectorOptions)","description":"The options of a vector, or semantic, search to run instead of, or alongside,\nthe free-text query.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"[SearchCountStrategy](/references/types/SearchTypes/types/types.SearchTypes.SearchCountStrategy)","description":"How the total number of matching documents is computed. `\"exact\"` may be\nrejected or slow depending on the provider.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_options","type":"`Record<string, Record<string, unknown>>`","description":"Escape hatch for engine features the interface does not model, keyed by\nprovider identifier, e.g. `{ typesense: { drop_tokens_threshold: 0 } }`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[QueryContextType](/references/types/CommonTypes/types/types.CommonTypes.QueryContextType)","description":"The context passed to the `query.graph` call during hydration.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"search-returns-1"},{"kind":"typeList","sectionTitle":"search","types":[{"name":"Promise","type":"Promise<[SearchResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.SearchResultSet)<TEntry>>","optional":false,"defaultValue":"","description":"Runs a search and expands the hits with `query.graph`.\n\nThe engine only holds what its index was defined with, so the requested\nfields are split: what the index can return comes back from the search, and\nthe rest is fetched by id. Search order is preserved through the expand.\n\nPass an array to run several queries in one provider round-trip — InstantSearch\nextra facet requests, or `disjunctive_facets` expansion, go through this path.","expandable":false,"children":[]}]},{"kind":"heading","level":3,"text":"index","id":"index"},{"kind":"heading","level":4,"text":"Type Parameters","id":"index-type-parameters"},{"kind":"typeList","sectionTitle":"index","types":[{"name":"TEntry","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":4,"text":"Parameters","id":"index-parameters"},{"kind":"typeList","sectionTitle":"index","types":[{"name":"queryOptions","type":"[RemoteQueryInput](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryInput)<TEntry> & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"joinFilters","type":"[RemoteQueryFilters](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFilters)<TEntry>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$or","type":"T & [RemoteQueryFilterOperators](/references/types/types/types.RemoteQueryFilterOperators)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"T & [RemoteQueryFilterOperators](/references/types/types/types.RemoteQueryFilterOperators)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"T & [RemoteQueryFilterOperators](/references/types/types/types.RemoteQueryFilterOperators)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"options","type":"[RemoteJoinerOptions](/references/types/interfaces/types.RemoteJoinerOptions)","description":"Options controlling the behavior of a remote joiner query execution.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"throwIfKeyNotFound","type":"`boolean`","description":"Whether to throw an error if a requested key is not found in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"throwIfRelationNotFound","type":"`boolean` \\| `string`[]","description":"Whether to throw an error if a requested relation is not found, or a list of relation names to check.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialData","type":"`object` \\| `object`[]","description":"Initial data to use as the starting dataset for the query instead of fetching from a service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"initialDataOnly","type":"`boolean`","description":"Whether to use only the initial data without fetching additional data from services.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"`string`","description":"The locale to use for the query.\nTranslation will be applied to the query result based on the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enable","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to enable the cache. This is only useful if you want to enable without providing any\nother options or if you want to enable/disable the cache based on the arguments.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"key","type":"`string` \\| (`args`: `any`[], `cachingModule`: [ICachingModuleService](/references/types/CachingTypes/interfaces/types.CachingTypes.ICachingModuleService)) => `string` \\| Promise<string>","description":"The key to use for the cache.\nIf a function is provided, it will be called with the arguments as the first argument and the\ncontainer as the second argument.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The tags to use for the cache. Used on their own unless\n`computeAutomaticTags` is set, in which case the automatically computed tags\nare stored alongside them.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"computeAutomaticTags","type":"`boolean`","description":"Whether the automatically computed tags should be applied along with the ones\ngiven in `tags`, rather than `tags` being used on its own.\n\nAutomatic tags are computed from the result, which only exposes entities that\ncarry an `id`. They therefore never cover link tables (whose rows are usually\nnot selected), relations queried without their `id`, or entities that affect\nthe result without appearing in it - pass only those in `tags` and enable this,\ninstead of restating every entity the result already exposes.\n\nHas no effect when `tags` is omitted, since tags are computed either way.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"ttl","type":"`number` \\| (`args`: `any`[]) => `undefined` \\| `number`","description":"The time-to-live (TTL) value in seconds.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"autoInvalidate","type":"`boolean` \\| (`args`: `any`[]) => `undefined` \\| `boolean`","description":"Whether to auto invalidate the cache whenever it is possible.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"`string`[] \\| (`args`: `any`[]) => `undefined` \\| `string`[]","description":"The providers to use for the cache.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"index-returns"},{"kind":"typeList","sectionTitle":"index","types":[{"name":"Promise","type":"Promise<[GraphResultSet](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet)<TEntry>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} |