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.*?\(.*?\) /,
'',
export async function evaluateFixtures(
fixturePaths: string[],
{cwd}: Options,
): Promise {
const config = getGraphQLConfig(resolve(cwd));
const projectASTCollection = await Promise.all(
getGraphQLProjects(config).map(getOperationsForProject),
);
return runForEachFixture(fixturePaths, (fixture) =>
evaluateFixture(fixture, projectASTCollection),
);
}
.map(({projectAST: {config}}) => resolveProjectName(config))
.join(', ')}.`,