GraphQL.js, on the other hand, is unable to connect to a database directly. In response to a request, GraphQL simply executes the code you give. The actual database contact is usually done through a driver (such as mongodb) or an ORM (like mongoose).
So a client (like your React app) sends a request to your Express app, which parses it and sends it to GraphQL, which runs your query and, in the process, invokes some code that retrieves data from your database. This information is structured and returned to the client in an appropriate response.