From cfb7d04e813636adfecc00dee246ca1cc5cd8043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Tue, 4 Jun 2019 15:01:26 +0200 Subject: [PATCH] [RelaySourceModuleParser] Format source path relative to cwd Either an absolute path or a path relative to the wd is necessary for IDEs to find the file in question. --- packages/relay-compiler/core/RelaySourceModuleParser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/relay-compiler/core/RelaySourceModuleParser.js b/packages/relay-compiler/core/RelaySourceModuleParser.js index e01330880691..91dee5686a8e 100644 --- a/packages/relay-compiler/core/RelaySourceModuleParser.js +++ b/packages/relay-compiler/core/RelaySourceModuleParser.js @@ -69,7 +69,7 @@ module.exports = ( memoizedTagFinder(text, baseDir, file).forEach(tag => { const source = new GraphQL.Source( tag.template, - file.relPath, + path.join(path.relative(process.cwd(), baseDir), file.relPath), tag.sourceLocationOffset, ); const ast = parseGraphQL(source);