MCPcopy Index your code
hub / github.com/subquery/subql / toVariables

Function toVariables

packages/utils/src/graphql/builder.ts:69–79  ·  view source on GitHub ↗
(vars: GqlVar[])

Source from the content-addressed store, hash-verified

67};
68
69const toVariables = (vars: GqlVar[]) =>
70 vars.reduce(
71 (acc, v) => {
72 if (acc[v.name]) {
73 throw new Error(`Graphql variables conflicts $${v.name}`);
74 }
75 acc[v.name] = v.value;
76 return acc;
77 },
78 {} as Record<string, unknown>
79 );
80
81export function buildQuery(vars: GqlVar[], nodes: GqlNode[]): GqlQuery {
82 return {

Callers 1

buildQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected