Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
}
config.externalFragments.push({
level,
isExternal: true,
importFrom: fragmentImportPath,
name: fragmentName,
onType: fragmentDetails.onType,
node: fragmentDetails.node,
});
}
}
if (
isUsingTypes(
documentFile.content,
config.externalFragments.map(m => m.name),
schemaObject
)
) {
plugins.unshift({ add: `import * as ${importTypesNamespace} from '${relativeImportPath}';\n` });
}
return {
filename: generatedFilePath,
plugins,
pluginMap,
config,
schema: options.schema,
schemaAst: schemaObject,
documents: [documentFile],
options.documents.map(documentFile => {
if (
isUsingTypes(
documentFile.content,
config.externalFragments.map(m => m.name),
options.schemaAst
)
) {
plugins.unshift({ add: `import * as ${importTypesNamespace} from '${options.presetConfig.typesPath}';\n` });
}
});
return [