Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.reportError(graphqlValidationError(errors, filePath))
return compiledNodes
}
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) {
this.reportError(graphqlError(namePathMap, nameDefMap, error))
return compiledNodes
}
// relay-compiler v1.5.0 added "StripUnusedVariablesTransform" to
// printTransforms. Unfortunately it currently doesn't detect variables
// in input objects widely used in gatsby, and therefore removing
// variable declaration from queries.
// As a temporary workaround remove that transform by slicing printTransforms.