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

attachConnectorsToContext undefined #47

Closed
mimamuh opened this issue May 12, 2016 · 3 comments
Closed

attachConnectorsToContext undefined #47

mimamuh opened this issue May 12, 2016 · 3 comments

Comments

@mimamuh
Copy link

mimamuh commented May 12, 2016

Hi,

I can't load the attachConnectorsToContext tool as described here: http://docs.apollostack.com/apollo-server/connectors.html. It seems it isn't included in the src/index.js

By the way: Are the connectors from the tutorial the same as the connectors from the docs here conceptually?

The first is to connect to my dbs, the second to have a cache for the current query. I see they fit together but it's confusing as the names are almost the same but for slightly different purposes. Is it on purpose?

Thx!

@helfer
Copy link
Contributor

helfer commented May 12, 2016

@mimamuh Thanks for reporting this, I did indeed forget to export them. I will fix it with the next PR.

You're right, these two definitions are not exactly the same. We're still working on the details for connectors, and it has even evolved a bit since then. I'm currently working on PR #46 that has a bit more specifics, but is still not quite final. Would be great if you could give that a read and tell me if it makes sense!

Once we have something more stable, the docs should be updated.

@mimamuh
Copy link
Author

mimamuh commented May 13, 2016

Hi, yeah, it makes sense at first glance. I like your ideas!

If I understood it properly, the connectors would cache and maybe batch my calls to the db automatically per graphql-query? It would be awesome. And the models are there to manage different connector per query when needed. Would things like permission handling be part of models or the resolve functions then?

@helfer
Copy link
Contributor

helfer commented May 13, 2016

Yes, connectors would cache per query and batch (per tick on Node). They could also be made to cache for longer, of course, that should be easy.

Permissions should be handled in models, or in some cases resolvers (not 100% sure yet). I'm thinking that decorators will be very interesting for permissions.

martijnwalraven pushed a commit that referenced this issue Oct 16, 2017
Inline with graphql documentation.
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

No branches or pull requests

2 participants