Skip to content

Commit af7407f

Browse files
authored
Merge pull request #47 from tanem/nexus
Use Nexus
2 parents 2a8c709 + 0a2df1d commit af7407f

31 files changed

+2079
-416
lines changed

package-lock.json

Lines changed: 1437 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,30 @@
1515
"build": "npm run clean && npm run generate && tsc -p tsconfig.base.json",
1616
"clean": "rm -rf dist",
1717
"dev": "cross-env DATABASE_URL=file:./dev.db ts-node-dev --no-notify --respawn --transpile-only src/start.ts",
18-
"generate": "prisma generate",
18+
"generate": "npm run generate:prisma && npm run generate:nexus",
19+
"generate:nexus": "cross-env NODE_ENV=development ts-node --transpile-only src/schema",
20+
"generate:prisma": "prisma generate",
1921
"migrate": "prisma migrate up -c --experimental",
22+
"postinstall": "npm run generate",
2023
"start": "node dist/src/start",
2124
"test": "cross-env-shell DATABASE_URL=file:./test.db \"npm run migrate && jest -i\"",
2225
"test:coverage": "npm t -- --coverage",
2326
"test:watch": "npm t -- --watchAll"
2427
},
2528
"dependencies": {
26-
"@prisma/client": "2.7.1",
29+
"@nexus/schema": "0.15.0",
2730
"bcryptjs": "2.4.3",
2831
"graphql-yoga": "1.18.3",
29-
"jsonwebtoken": "8.5.1"
32+
"jsonwebtoken": "8.5.1",
33+
"lodash": "4.17.20",
34+
"nexus-plugin-prisma": "0.19.0"
3035
},
3136
"devDependencies": {
32-
"@prisma/cli": "2.7.1",
3337
"@types/bcryptjs": "2.4.2",
3438
"@types/chance": "1.1.0",
3539
"@types/jest": "26.0.14",
3640
"@types/jsonwebtoken": "8.5.0",
41+
"@types/lodash": "4.14.161",
3742
"@types/node": "14.11.2",
3843
"@types/supertest": "2.0.10",
3944
"@types/ws": "7.2.6",

prisma/dev.db

0 Bytes
Binary file not shown.

src/__tests__/__snapshots__/mutation.post.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Object {
2525
"data": Object {
2626
"post": Object {
2727
"description": "Cermamu tidrucnil nulus javwojzov dukkahkor.",
28-
"id": "1",
28+
"id": 1,
2929
"postedBy": Object {
30-
"id": "1",
30+
"id": 1,
3131
"name": "Josephine",
3232
},
3333
"url": "http://iloemfa.de/magila",

src/__tests__/__snapshots__/mutation.signup.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Object {
66
"signup": Object {
77
"token": Any<String>,
88
"user": Object {
9-
"id": Any<String>,
9+
"id": Any<Number>,
1010
},
1111
},
1212
},

src/__tests__/__snapshots__/mutation.vote.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ exports[`new vote 1`] = `
2626
Object {
2727
"data": Object {
2828
"vote": Object {
29-
"id": "1",
29+
"id": 1,
3030
"link": Object {
3131
"description": "Nem nokibof bar jilhe puwa.",
32-
"id": "1",
32+
"id": 1,
3333
"url": "http://gobhaptem.mq/ki",
3434
},
3535
"user": Object {
3636
"email": "juhiza@sapeag.zw",
37-
"id": "1",
37+
"id": 1,
3838
"name": "Dollie",
3939
},
4040
},

src/__tests__/__snapshots__/query.feed.test.ts.snap

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ Object {
1919
"links": Array [
2020
Object {
2121
"description": "Fef no gocinfan fe gu.",
22-
"id": "2",
22+
"id": 2,
2323
"postedBy": Object {
24-
"id": "1",
24+
"id": 1,
2525
"name": "Johnny",
2626
},
2727
"url": "http://dum.dj/tofej",
2828
"votes": Array [],
2929
},
3030
Object {
3131
"description": "Jutezuj ce ova wozo tim.",
32-
"id": "3",
32+
"id": 3,
3333
"postedBy": Object {
34-
"id": "1",
34+
"id": 1,
3535
"name": "Johnny",
3636
},
3737
"url": "http://ife.fr/rogeuco",
3838
"votes": Array [],
3939
},
4040
Object {
4141
"description": "Sa uvian ed laurapu re.",
42-
"id": "4",
42+
"id": 4,
4343
"postedBy": Object {
44-
"id": "1",
44+
"id": 1,
4545
"name": "Johnny",
4646
},
4747
"url": "http://zobekdiv.sg/soki",
@@ -61,49 +61,49 @@ Object {
6161
"links": Array [
6262
Object {
6363
"description": "Fano ki wetu lehmuh razi.",
64-
"id": "1",
64+
"id": 1,
6565
"postedBy": Object {
66-
"id": "1",
66+
"id": 1,
6767
"name": "Johnny",
6868
},
6969
"url": "http://bizbah.yt/mag",
7070
"votes": Array [],
7171
},
7272
Object {
7373
"description": "Fef no gocinfan fe gu.",
74-
"id": "2",
74+
"id": 2,
7575
"postedBy": Object {
76-
"id": "1",
76+
"id": 1,
7777
"name": "Johnny",
7878
},
7979
"url": "http://dum.dj/tofej",
8080
"votes": Array [],
8181
},
8282
Object {
8383
"description": "Jutezuj ce ova wozo tim.",
84-
"id": "3",
84+
"id": 3,
8585
"postedBy": Object {
86-
"id": "1",
86+
"id": 1,
8787
"name": "Johnny",
8888
},
8989
"url": "http://ife.fr/rogeuco",
9090
"votes": Array [],
9191
},
9292
Object {
9393
"description": "Sa uvian ed laurapu re.",
94-
"id": "4",
94+
"id": 4,
9595
"postedBy": Object {
96-
"id": "1",
96+
"id": 1,
9797
"name": "Johnny",
9898
},
9999
"url": "http://zobekdiv.sg/soki",
100100
"votes": Array [],
101101
},
102102
Object {
103103
"description": "Useri rorur piz ruefuaj hebak.",
104-
"id": "5",
104+
"id": 5,
105105
"postedBy": Object {
106-
"id": "1",
106+
"id": 1,
107107
"name": "Johnny",
108108
},
109109
"url": "http://hasme.mm/bubtocfab",
@@ -123,45 +123,45 @@ Object {
123123
"links": Array [
124124
Object {
125125
"description": "Fano ki wetu lehmuh razi.",
126-
"id": "1",
126+
"id": 1,
127127
"postedBy": Object {
128-
"id": "1",
128+
"id": 1,
129129
"name": "Johnny",
130130
},
131131
"url": "http://bizbah.yt/mag",
132132
},
133133
Object {
134134
"description": "Fef no gocinfan fe gu.",
135-
"id": "2",
135+
"id": 2,
136136
"postedBy": Object {
137-
"id": "1",
137+
"id": 1,
138138
"name": "Johnny",
139139
},
140140
"url": "http://dum.dj/tofej",
141141
},
142142
Object {
143143
"description": "Jutezuj ce ova wozo tim.",
144-
"id": "3",
144+
"id": 3,
145145
"postedBy": Object {
146-
"id": "1",
146+
"id": 1,
147147
"name": "Johnny",
148148
},
149149
"url": "http://ife.fr/rogeuco",
150150
},
151151
Object {
152152
"description": "Sa uvian ed laurapu re.",
153-
"id": "4",
153+
"id": 4,
154154
"postedBy": Object {
155-
"id": "1",
155+
"id": 1,
156156
"name": "Johnny",
157157
},
158158
"url": "http://zobekdiv.sg/soki",
159159
},
160160
Object {
161161
"description": "Useri rorur piz ruefuaj hebak.",
162-
"id": "5",
162+
"id": 5,
163163
"postedBy": Object {
164-
"id": "1",
164+
"id": 1,
165165
"name": "Johnny",
166166
},
167167
"url": "http://hasme.mm/bubtocfab",

src/__tests__/__snapshots__/subscription.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ exports[`new link 1`] = `
44
Object {
55
"newLink": Object {
66
"description": "Pevva haekaop lo be mi.",
7-
"id": "2",
7+
"id": 2,
88
"postedBy": Object {
9-
"id": "1",
9+
"id": 1,
1010
"name": "Leo",
1111
},
1212
"url": "http://zukame.az/folpodni",
@@ -17,7 +17,7 @@ Object {
1717
exports[`new vote 1`] = `
1818
Object {
1919
"newVote": Object {
20-
"id": "1",
20+
"id": 1,
2121
"link": Object {
2222
"description": "Og ah nesriaco ge aziaw.",
2323
"url": "http://fopone.ai/pibene",

src/__tests__/mutation.signup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test('signup', async () => {
4040
signup: {
4141
token: expect.any(String),
4242
user: {
43-
id: expect.any(String),
43+
id: expect.any(Number),
4444
},
4545
},
4646
},

0 commit comments

Comments
 (0)