-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
this is my relay.config.json file:
{
"src": "./",
"language": "typescript",
"schema": "../../schema/schema.graphql",
"artifactDirectory": "./__generated__",
"excludes": ["**/node_modules/**", "**/__mocks__/**", "**/__tests__/**"],
"useImportTypeSyntax": true,
"persistConfig": {
"url": "http://localhost:2999",
"includeQueryText": false,
"concurrency": 1
},
}when I run the relay-compiler --validate command and there are no changes to the artifacts to be built, everything is working fine.
But when there is a change- I get this error:
➜ accounts (main) relay-compiler --validate ✭
[INFO] Querying files to compile...
[INFO] [default] compiling...
[ERROR] Error: Network error: error trying to connect: tcp connect error: Connection refused (os error 111)
[ERROR] Compilation failed.
[ERROR] Unable to run relay compiler. Error details:
Failed to build:
- Persisting operation(s) failed:
- Network error: error trying to connect: tcp connect error: Connection refused (os error 111)this is because I run a local persisting server.
This is an issue especially during CI checks where it doesn't make sense to run this type of server.
Ideally the command should just error out without the network error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]relay-compiler --validate shouldn't require persistConfig url to be running[/-][+][Bug] relay-compiler --validate shouldn't require persistConfig url to be running[/+]captbaritone commentedon May 30, 2025
It sounds sensible on its face. You could try changing this code so that we don't set the persister if we are in validate mode.
relay/compiler/crates/relay-bin/src/main.rs
Lines 315 to 332 in 8c30f80
I don't think we have bandwidth to work on this, but if you can open a PR that does not add much complexity we'd be open to it.
Disable persisted queries in validate mode (facebook#5013)