I have a monorepo setup with multiple relay projects. I usually open vscode at the root of the repo. The apollo vscode project seem to handle multiple apollo.config.js files well but relay-config does not.
Setup looks like:
folderA:
- apollo.config.js
- relay.config.js
folderB:
- apollo.config.js
- relay.config.js
The issue is that relay-config expects cwd to contain a config file but in the context apollo.config.js is run it will be set to the root folder opened in vscode. As a workaround I changed my apollo.config.js to
process.chdir(__dirname);
const { config } = require('vscode-apollo-relay').generateConfig();
module.exports = config;
Not sure if we just want to change the documentation to this instead or find a better way to fix the issue.