Skip to content

get-graphql-schema.sh script fails without access to db #16

@mnaamani

Description

@mnaamani

The script starts a graphql server instance, but seems to fail immediately if a database is not reachable. So the scripts fails to fetch the schema:

Graphql server fails:

FATAL sqd:graphql-server Error: connect ECONNREFUSED ::1:5432
                                      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
                                      errno: -61
                                      code: ECONNREFUSED
                                      syscall: connect
                                      address: ::1
                                      port: 5432

so fetching schema is failing

FetchError: request to http://localhost:4352/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:4352
    at ClientRequest.<anonymous> (/squid/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:517:28)
    at Socket.socketErrorListener (node:_http_client:501:9)
    at Socket.emit (node:events:517:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}
Schema output is empty. Skipping overwriting schema file.

I think the behavior of the graphql server has changed recently, as this script used to work even if the database was uncreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions