(vars: GqlVar[])
| 67 | }; |
| 68 | |
| 69 | const 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 | |
| 81 | export function buildQuery(vars: GqlVar[], nodes: GqlNode[]): GqlQuery { |
| 82 | return { |