Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use resolvers context to access dgraph and postgres #106

Closed
wants to merge 1 commit into from

Conversation

charlie-wasp
Copy link
Contributor

@charlie-wasp charlie-wasp commented Dec 29, 2018

Resolve #101

It may be a good idea to use shared context in resolvers to obtain connections to our storages (dgraph and postgres). At least, this is how it said in Apollo server docs 😁

@gzigzigzeo was concerned about resources freeing and connection pooling. I guess, pg-promise got us covered here, it has a connection pool, it's described in the README. Dgraph case is more complicated for me because its JS client uses protobuf (so we're talking about gRPC connections, right?), and I am not familiar with that. However, they are just an HTTP connections? What problems can we have here? What bothers me is that dgraph-js docs state, that resources must be cleared explicitly. We do that on ingest, but we don't do that on queries. Maybe we can use express server, and put dgraph "resources freeing" in some "after request" hook?

What do you think about it?

Yeah, also I renamed vaguely named Connection class here to Dgraph


This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use resolvers context to access dgraph and postgres
1 participant