MCPcopy
hub / github.com/subquery/subql / getTypeByScalarName

Function getTypeByScalarName

packages/utils/src/types/generalTypes.ts:16–25  ·  view source on GitHub ↗
(type: N | string)

Source from the content-addressed store, hash-verified

14export type TypeNames = (typeof supportedTypes)[keyof typeof supportedTypes]['name'];
15
16export function getTypeByScalarName<
17 T extends keyof TypeNameMap,
18 R extends TypeNameMap[T]['hashCodeArg'],
19 N extends TypeNameMap[T]['name'],
20>(type: N | string): TypeClass<N, R> | undefined {
21 const typeClass = Object.values(supportedTypes).find(({name}) => name === type);
22 if (!typeClass) return undefined;
23
24 return typeClass as TypeClass<N, R>;
25}

Callers 5

getAllEntitiesRelationsFunction · 0.90
processFieldsFunction · 0.90
getColumnOptionFunction · 0.90

Calls 1

findMethod · 0.65

Tested by

no test coverage detected