MCPcopy Create free account
hub / github.com/subquery/subql / isIndexed

Method isIndexed

packages/node-core/src/indexer/store.service.ts:416–428  ·  view source on GitHub ↗
(entity: string, field: string)

Source from the content-addressed store, hash-verified

414 }
415
416 isIndexed(entity: string, field: string): boolean {
417 const indexes = this.modelProvider.getModel(entity).model.options.indexes ?? [];
418
419 return (
420 indexes.findIndex((idx) => {
421 const matchingField = idx.fields?.find((f) => {
422 const fieldName = (f as any).name ?? f;
423 return camelCase(fieldName) === customCamelCaseGraphqlKey(field);
424 });
425 return !!matchingField;
426 }) > -1
427 );
428 }
429
430 isIndexedHistorical(entity: string, field: string): boolean {
431 const indexes = this.modelProvider.getModel(entity).model.options.indexes ?? [];

Callers 3

getByFieldMethod · 0.80
getByFieldsMethod · 0.80

Calls 3

getModelMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected