MCPcopy Create free account
hub / github.com/decaporg/decap-cms / buildFilesQuery

Function buildFilesQuery

packages/decap-cms-backend-github/src/queries.ts:66–97  ·  view source on GitHub ↗
(depth = 1)

Source from the content-addressed store, hash-verified

64`;
65
66function buildFilesQuery(depth = 1) {
67 const PLACE_HOLDER = 'PLACE_HOLDER';
68 let query = oneLine`
69 ...ObjectParts
70 ... on Tree {
71 entries {
72 ...FileEntryParts
73 ${PLACE_HOLDER}
74 }
75 }
76 `;
77
78 for (let i = 0; i < depth - 1; i++) {
79 query = query.replace(
80 PLACE_HOLDER,
81 oneLine`
82 object {
83 ... on Tree {
84 entries {
85 ...FileEntryParts
86 ${PLACE_HOLDER}
87 }
88 }
89 }
90 `,
91 );
92 }
93
94 query = query.replace(PLACE_HOLDER, '');
95
96 return query;
97}
98
99export function files(depth: number) {
100 return gql`

Callers 1

filesFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected