Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function getOperationsForProject(
projectConfig: GraphQLProjectConfig,
): Promise {
const operationPaths = await getGraphQLProjectIncludedFilePaths(
projectConfig,
);
const operationSources = await Promise.all(
operationPaths.map(loadOperationSource),
);
const document = concatAST(
operationSources.map((source) => {
try {
return parse(source);
} catch (error) {
throw new Error(
`Error parsing '${source.name}':\n\n${error.message.replace(
/Syntax Error.*?\(.*?\) /,
'',