Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
documents.push(doc)
doc.definitions.forEach((def: any) => {
const name: string = def.name.value
namePathMap.set(name, filePath)
nameDefMap.set(name, def)
})
}
let compilerContext = new GraphQLCompilerContext(this.schema)
try {
compilerContext = compilerContext.addAll(
ASTConvert.convertASTDocuments(
this.schema,
documents,
validationRules,
RelayParser.transform.bind(RelayParser)
)
)
} catch (error) {
const { formattedMessage, docName, message, codeBlock } = graphqlError(
namePathMap,
nameDefMap,
error
)
nameErrorMap.set(docName, { formattedMessage, message, codeBlock })
boundActionCreators.queryExtractionGraphQLError({
componentPath: namePathMap.get(docName),
error: formattedMessage,
})
this.reportError(formattedMessage)
return false
}