We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 155e50d commit cff3cfeCopy full SHA for cff3cfe
README.md
@@ -34,6 +34,8 @@ This package uses [DataLoader](https://github.com/graphql/dataloader) for batchi
34
35
The basic setup is subclassing `MongoDataSource`, passing your collection or Mongoose model to the constructor, and using the [API methods](#API):
36
37
+`data-sources/Users.js`
38
+
39
```js
40
import { MongoDataSource } from 'apollo-datasource-mongodb'
41
@@ -47,8 +49,13 @@ export default class Users extends MongoDataSource {
47
49
and:
48
50
51
52
+import { MongoClient } from 'mongodb'
53
54
import Users from './data-sources/Users.js'
55
56
+const client = new MongoClient('mongodb://localhost:27017/test')
57
+const db = client.db()
58
59
const server = new ApolloServer({
60
typeDefs,
61
resolvers,
0 commit comments