Skip to content

[Bug] relay-compiler --validate shouldn't require persistConfig url to be running #5007

Open
@aryaniyaps

Description

@aryaniyaps

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

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions