-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Schema extensions are ignored on MacOS, but not on Linux #4557
Comments
Upon additional investigation, the issue is that on Mac, we create a Watchman query containing
Changing this to |
Thanks for the report and the followup. Should we be creating a different Watchman query here maybe? Or maybe just be more explicit (including validation) that we are expecting directories? |
Looks like in the Rust code we are expecting directories here. Maybe we can add a runtime validation that ensures they are existing directories before creating the Watchman query?
|
We have been using relay for 2 years. Today i tried to install Watchman on my windows laptop to use the This is our config file: // relay.config.js
module.exports = {
schema: 'schema.server.graphql',
src: 'src',
excludes: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'],
noFutureProofEnums: true,
language: 'typescript',
customScalars: {},
schemaExtensions: ['src/relay/schema.client.graphql'],
}; Our dev deps:
If i manually add the schema definitions in |
I believe the schemaExtensions is supposed to point to a directory that contains *.graphql files with the extensions. At least that is what has worked for me... |
I discovered that it functions correctly when both the schema file and the schemaExtensions files are placed in the same directory. As demonstrated here (modified from @rbalicki2's demo project): // <project-root>/schema/schema-extension.graphql is the local-schema-extension file
// <project-root>/schema/schema.graphql is the server-schema file
// relay.config.js
module.exports = {
src: "./src",
language: "typescript",
schema: "./schema/schema.graphql",
schemaExtensions: ["./schema"],
excludes: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"],
}; I'm not sure if this is the intended behavior or a bug. |
In the Relay documentation the
Watchman will return the contents of the @captbaritone Is there any reason |
I created a PR to allow This already worked when using the walkdir implementation (when watchman is disabled or not available). I also notice that in the Relay tests the fixtures uses It's interesting now how the Schema can be defined explicitly as either |
It looks like schema extensions are ignored on Mac, but not on Linux (x64). Is there a workaround?
Steps to reproduce
yarn && yarn relay
On Mac (platform: darwin, arch: arm64), this fails to compile, due to a missing field. On Linux (platform: linux, arch: x64), this successfully compiles.
The contents of the schema extension file can be arbitrary on Mac; it is never even parsed. However, it must exist.
Thank you!
The text was updated successfully, but these errors were encountered: