Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The schema configured for project default does not exist at #4771

Open
FezVrasta opened this issue Aug 14, 2024 · 0 comments
Open

The schema configured for project default does not exist at #4771

FezVrasta opened this issue Aug 14, 2024 · 0 comments

Comments

@FezVrasta
Copy link

FezVrasta commented Aug 14, 2024

I'm trying to use the Relay extension for Visual Studio Code on my monorepo project (Yarn monorepo).

My Relay configuration file is at workspaces/web-client/relay.config.js, and my schema is at workspaces/backend/schema.graphql.

module.exports = {
  src: ".",
  language: "typescript",
  schema: "../backend/schema.graphql",
  excludes: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"],
};

When I use the relay compiler from CLI everything works fine (relay-compiler --watch --output quiet-with-errors), but when I use the extension I get this error:

[ERROR] Config `/Users/federicozivolo/Developer/my-project/workspaces/web-client/relay.config.js` is invalid:
 - The `schema` configured for project `default` does not exist at `../backend/schema.graphql`.

I also tried to move the graphql file to the web-client folder, and update the schema: property but I get the same error.

What worked for me is to resolve the path to an absolute one in the config file:

const path = require("node:path");

module.exports = {
  src: ".",
  language: "typescript",
  schema: path.resolve(__dirname, "../backend/schema.graphql"),
  excludes: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"],
};
"relay-compiler": "17.0.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant