meteor-integration icon indicating copy to clipboard operation
meteor-integration copied to clipboard

Document how to call code that relies on server-side global Meteor.userId()

Open lorensr opened this issue 9 years ago • 4 comments

Cross-posted from https://github.com/apollostack/docs/issues/23

lorensr avatar Jun 16 '16 19:06 lorensr

Wouldn't mutations and queries replace meteor methods and pub/sub? So, we wouldn't need to use Meteor.userId() at all because this where we get the user info. Am I right?

kokjinsam avatar Jun 16 '16 19:06 kokjinsam

We would use context.userId in our own code, but maybe we're calling a library that assumes the presence of Meteor.userId on the server.

lorensr avatar Jun 16 '16 19:06 lorensr

Ah ok. gotcha!

kokjinsam avatar Jun 16 '16 19:06 kokjinsam

@lorensr, I will be supporting that out of the box in ddp-apollo. It will just work, even if you use an HTTP endpoint. See above PR for details. Cheers.

jamiter avatar Jun 05 '18 06:06 jamiter