1 {"slug":"/references/modules_sdk/classes/modules_sdk.RemoteJoiner","title":"RemoteJoiner","frontmatter":{},"toc":[{"title":"constructor","id":"constructor","level":2},{"title":"Parameters","id":"constructor-parameters","level":3},{"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}],"blocks":[{"kind":"markdown","html":"Executes cross-module graph queries by resolving relationships from module\njoiner configs.\n\nPipeline: GraphCatalog (index configs) → compileQuery\n(query → plan) → executePlan (fetch + join + shortcuts).\n\nData loading is delegated to IRemoteDataFetcher (typically\nModuleDataFetcher). Query is the public entry point that normalizes user\ninput and invokes [RemoteJoiner.query](/references/modules_sdk/classes/modules_sdk.RemoteJoiner#query)."},{"kind":"heading","level":2,"text":"constructor","id":"constructor"},{"kind":"heading","level":3,"text":"Parameters","id":"constructor-parameters"},{"kind":"typeList","sectionTitle":"constructor","types":[{"name":"serviceConfigs","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":"alias","type":"`string`","description":"The alias used to reference the related service in queries.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"The foreign key field on the related service used to join the relationship.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"The primary key field on the current service used to join the relationship.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"The name of the related service.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity","type":"`string`","description":"The entity name within the related service.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleteCascade","type":"`boolean`","description":"If true, the link joiner will cascade deleting the relationship","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filterable","type":"`string`[]","description":"The fields to be filterable by the Index module using query.index","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hasMany","type":"`boolean`","description":"Allow multiple relationships to exist for this\nentity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fieldAlias","type":"`Record<string, string \\| object>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationship","type":"Omit&#60;[ModuleJoinerRelationship](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship), \"hasMany\"&#62;","description":"","optional":false,"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 &#123; product\\_id: \"Product\" &#125; \"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":"tableName","type":"`string`","description":"Name of the pivot table. If not provided it is auto generated","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefix","type":"`string`","description":"Prefix for the id column. If not provided it is \"link\"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraFields","type":"[LinkModulesExtraFields](/references/types/ModulesSdkTypes/types/types.ModulesSdkTypes.LinkModulesExtraFields)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"dataFetcher","type":"`IRemoteDataFetcher`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"autoCreateServiceNameAlias","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationMap","type":"`RelationMap`","description":"","optional":true,"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":"queryObj","type":"[RemoteJoinerQuery](/references/types/interfaces/types.RemoteJoinerQuery)","description":"A query object used by the remote joiner to fetch and join data across services.","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":"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&#60;string&#62;","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&#60;any&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]}