MCPcopy Create free account
hub / github.com/firebase/firebase-tools / squashGraphQL

Function squashGraphQL

src/dataconnect/load.ts:244–261  ·  view source on GitHub ↗
(source: Source)

Source from the content-addressed store, hash-verified

242 * @return combined file contents, possible deliminated by boundary comments.
243 */
244export function squashGraphQL(source: Source): string {
245 if (!source.files || !source.files.length) {
246 return "";
247 }
248 if (source.files.length === 1) {
249 return source.files[0].content;
250 }
251 let query = "";
252 for (const f of source.files) {
253 if (!f.content || !/\S/.test(f.content)) {
254 continue; // Empty or space-only file.
255 }
256 query += `### Begin file ${f.path}\n`;
257 query += f.content;
258 query += `### End file ${f.path}\n`;
259 }
260 return query;
261}

Callers 1

readQueryFromDirFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…