Skip to content

Commit b7c3cf8

Browse files
committed
🛠️ NPM
1 parent 4f1d5ea commit b7c3cf8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.github/workflows/CD.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313
- uses: actions/[email protected]
14-
with:
15-
registry-url: "https://npm.pkg.github.com"
16-
- run: yarn
17-
- run: yarn build
1814
- run: yarn publish
1915
env:
20-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
# MongoDataSource
2+
23
An Apollo GraphQL Datasource using MongoDB.
34

45
## Why
5-
While there already is a somewhat good MongoDB DataSource package available ([apollo-datasource-mongodb](https://github.com/GraphQLGuide/apollo-datasource-mongodb)), it still lacks some features / functions that we needed in our projects, while it doesn't *yet* support the main feature of the existing package ([Batching](https://github.com/GraphQLGuide/apollo-datasource-mongodb#batching)), it fixes other small issues like the prevention of spamming MongoDB with requests when there's already a query running for it.
6+
7+
While there already is a somewhat good MongoDB DataSource package available ([apollo-datasource-mongodb](https://github.com/GraphQLGuide/apollo-datasource-mongodb)), it still lacks some features / functions that we needed in our projects, while it doesn't _yet_ support the main feature of the existing package ([Batching](https://github.com/GraphQLGuide/apollo-datasource-mongodb#batching)), it fixes other small issues like the prevention of spamming MongoDB with requests when there's already a query running for it.
68

79
This DataSource is currently in use by [PreMiD/API](https://github.com/PreMiD/API) at a large scale.
810

911
## Installation
12+
1013
```Shell
1114
# NPM
12-
npm i @recodive/mongodbdatasource
15+
npm i apollo-mongodb-datasource
1316

1417
# YARN
15-
yarn add @recodive/mongodbdatasource
18+
yarn add apollo-mongodb-datasource
1619
```
1720

1821
## Usage
22+
1923
### TypeScript
24+
2025
index.ts
26+
2127
```TS
2228
import { MongoClient } from 'mongodb'
2329

@@ -36,8 +42,9 @@ const server = new ApolloServer({
3642
```
3743

3844
Users.ts
45+
3946
```TS
40-
import MongoDataSource from '@Recodive/mongodatasource'
47+
import MongoDataSource from 'apollo-mongodb-datasource'
4148

4249
export default class Users extends MongoDataSource {
4350
getUser(userId: string) {

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@Recodive/mongodatasource",
2+
"name": "apollo-mongodb-datasource",
33
"version": "1.0.0",
44
"description": "An Apollo GraphQL Datasource using MongoDB.",
55
"main": "lib/index.js",
@@ -18,8 +18,5 @@
1818
},
1919
"devDependencies": {
2020
"typescript": "^4.4.4"
21-
},
22-
"publishConfig": {
23-
"registry": "https://npm.pkg.github.com/"
2421
}
2522
}

0 commit comments

Comments
 (0)