(node: GqlNode)
| 48 | } |
| 49 | |
| 50 | const bindProjections = (node: GqlNode): string => { |
| 51 | return `${node.entity} ${node.args ? `(${buildArgs(node.args)})` : ``}${ |
| 52 | node.project |
| 53 | ? `{${node.project |
| 54 | .map((el: GqlNode | string) => { |
| 55 | if (typeof el === 'string') { |
| 56 | return `${el} `; |
| 57 | } |
| 58 | return `${bindProjections(el)} `; |
| 59 | }) |
| 60 | .join('')}} ` |
| 61 | : `` |
| 62 | }`; |
| 63 | }; |
| 64 | |
| 65 | const toVarDefs = (vars: GqlVar[]): string => { |
| 66 | return vars && vars.length ? `(${vars.map((item) => `$${item.name}:${item.gqlType}`)})` : ``; |
no test coverage detected