You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using createTestClient of apollo-server-testing I do not known how to close it. Here is the code:
constserver=newApolloServerBase({
schema,context: ()=>newContext()//// FIXME: not closing});constclient=createTestClient(server);
So the database connection is not closed. How to have a hook/event informing that execution ended?
Also looking into the code, it seems the context function is called many times, so I'm not sure it's the way to put a resource into the testing server.
I don't found anything in the documentation regarding that matter.
The text was updated successfully, but these errors were encountered:
The new request pipeline that's in progress has support for setting up lifecycle hooks for opening and closing database connections both on server startup and during request handling in Apollo Server 3.0 roadmap (#2360). You can see the WIP documentation for these lifecycle hooks and try them out, too! We're going to be tracking these features on the roadmap item rather than spreading them out over issues, so I'll close this out for now. Thank you for the report!
When using
apollo-server-express
, I open the context (a database connection) that needs to be closed. So I do it in this way:When using
createTestClient
ofapollo-server-testing
I do not known how to close it. Here is the code:So the database connection is not closed. How to have a hook/event informing that execution ended?
Also looking into the code, it seems the
context
function is called many times, so I'm not sure it's the way to put a resource into the testing server.I don't found anything in the documentation regarding that matter.
The text was updated successfully, but these errors were encountered: