You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The request's context is available at `this.context`. For example, if you put the logged-in user's ID on context as `context.currentUserId`:
55
+
The collections are available at `this.collections` (e.g. `this.collections.users.update({_id: 'foo, { $set: { name: 'me' }}})`). The request's context is available at `this.context`. For example, if you put the logged-in user's ID on context as `context.currentUserId`:
53
56
54
57
```js
55
58
classMyMongoextendsMongoDataSource {
@@ -69,11 +72,6 @@ If you want to implement an initialize method, it must call the parent method:
69
72
70
73
```js
71
74
classMyMongoextendsMongoDataSource {
72
-
constructor() {
73
-
super()
74
-
this.collections= { users, posts }
75
-
}
76
-
77
75
initialize(config) {
78
76
super.initialize(config)
79
77
...
@@ -101,11 +99,6 @@ client.connect(e => {
101
99
})
102
100
103
101
classMyMongoextendsMongoDataSource {
104
-
constructor() {
105
-
super()
106
-
this.collections= { users, posts }
107
-
}
108
-
109
102
getUser(userId) {
110
103
returnthis.users.findOneById(userId)
111
104
}
@@ -128,7 +121,7 @@ const server = new ApolloServer({
0 commit comments