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

Support monorepo setups #509

Open
ivosabev opened this issue Nov 4, 2024 · 1 comment
Open

Support monorepo setups #509

ivosabev opened this issue Nov 4, 2024 · 1 comment

Comments

@ivosabev
Copy link

ivosabev commented Nov 4, 2024

The following setup needed for VSCode Relay extension to work with monorepos, doesn't work with vite-plugin-relay and throws ReferenceError: require is not defined where graphql template literal imported from react-relay is present.

If you put apps/app/relay.config.json file with eagerEsModules: true it will work. This hints me that the root relay.config.json is not read and respected, but I may be wrong.

apps/
  app/
  server/
  web/
relay.config.js

relay.config.js

{
  "root": ".",
  "sources": {
    "apps/app": "app"
    "apps/web": "web"
  },
  "excludes": ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"],
  "projects": {
    "app": {
      "eagerEsModules": true,
      "language": "typescript",
      "output": "apps/app/src/__generated__",
      "schema": "apps/server/src/schema/schema.graphql"
    },
    "web": {
      "eagerEsModules": true,
      "language": "typescript",
      "output": "apps/web/src/__generated__",
      "schema": "apps/server/src/schema/schema.graphql"
    }
  }
}
@ivosabev
Copy link
Author

ivosabev commented Nov 4, 2024

Might be relevant: facebook/relay#4407

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