-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
authentication using relay #294
Comments
Thanks for your question! We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Relay. Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #relayjs? We'll be happy to answer there. Post a link to your Stack Overflow question here, to so that we don't lose track of it. |
I'm going to close this now, but please do comment on it with a link back to your Stack Overflow post if you do make one, @almasakchabayev. |
Posted question on stackoverflow: http://stackoverflow.com/questions/32535141/relayjs-authentication-using-relay-which-mutation-to-use |
Posted a similar question, except I'm wondering how people are handling access control. Maybe I'm not imaginative enough, but I really am not really seeing this :< |
I second @dminkovsky, a sample code for handling access control with Relay will be much appreciated. |
@kassens' answer does help. Thank you @kassens. If I may follow up here, please, because it's difficult to discuss his answer via SO comments. @Kassen writes:
Totally makes sense. That's how I load users too and will extend this approach to the loading of all nodes. But in order to make that happen—for example, to do
Such a flow seems to have the following implications:
I'm only not sure about the last of these consequences. I suppose there is some "context" I can use. But I am new to this stack. Anyway, thank you very much. What a wonderful platform. |
This helpful post helps with my last bullet point from above, regarding the
The post then explains how this works. As @mugli says, would be great to distill all of this into an example in the repository so that users can get up and running quickly and also learn these features of the stack more easily. |
Oh, and sorry for the incremental updates—should have collected this into one follow-up post. But, anyway, having read the post mentioned above I looked at the I was really happy to find that you can pass an So this basically addresses all my questions above:
Great. Thank you! |
If anyone has problems with this topic: I made an example repo for Relay/GraphQL/express authentication. It saves session data (userId and role) in a cookie using express middleware and a GraphQL Mutation |
I am currently handling authentication outside of relay with custom header set in DefaultNetworkLayer.
Is it preferred way and Is there a way to do it in relay?
I was stuck when trying to implement sign up functionality in relay: in relay there are following configs: FIELDS_CHANGE, NODE_DELETE, RANGE_ADD, RANGE_DELETE. So RANGE_ADD is the only one applicable here, however I need a parent and connection for that, which I do not have for a newly created user....
The text was updated successfully, but these errors were encountered: