Commit f621804
Tom Coleman
Simplify authorized loader.
Thoughts here:
1. We only need one authorized loader (for the `readOne` case).
2. We can determine the `authQuery` at initialization time, assuming that a single user will be used for all queries (this is the case).
3. We can have the user at initialization time, although this will require refactoring the way the context is initialized here: https://github.com/tobkle/create-graphql-server/blob/master/skel/server/index.js
i. We need to add the models to the context *after* the authentication, i.e. here: https://github.com/tobkle/create-graphql-server/blob/master/skel/server/index.js#L44
ii. This will mean that we need a different reference to the mongo collection in the `passport.authenticate` call. But we can make that work I think, it doesn't really need the proper user collection.1 parent 884a8c5 commit f621804
1 file changed
+6
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
| |||
0 commit comments