Skip to content

Commit 73ba910

Browse files
committed
refactor: remove unused files, rename type-defs to schema, and update GraphQL server integration
1 parent e505d1c commit 73ba910

File tree

14 files changed

+7910
-90
lines changed

14 files changed

+7910
-90
lines changed

06-rest-api/03-graphql/02-crud/03-migrate-app/.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

06-rest-api/03-graphql/02-crud/03-migrate-app/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ test-report.*
66
junit.xml
77
*.log
88
*.orig
9-
package-lock.json
109
yarn.lock
1110
.awcache
11+
.DS_Store

06-rest-api/03-graphql/02-crud/03-migrate-app/.vscode/launch.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

06-rest-api/03-graphql/02-crud/03-migrate-app/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ npm install
1919

2020
# Steps
2121

22-
- Let's define `type-defs` for get one hotel by id:
22+
- Let's define `schema` for get one hotel by id:
2323

24-
### ./server/src/graphql/type-defs.ts
24+
### ./server/src/graphql/schema.ts
2525

2626
```diff
2727
...
@@ -48,7 +48,7 @@ export const resolvers = {
4848
const hotels = await getHotelList();
4949
return hotels;
5050
},
51-
+ hotel: async (parent, args): Promise<Hotel> => {
51+
+ hotel: async (args): Promise<Hotel> => {
5252
+ const hotel = await getHotel(args.id);
5353
+ return hotel;
5454
+ },
@@ -76,9 +76,9 @@ query {
7676

7777
```diff
7878
import Axios from 'axios';
79-
+ import { graphQLClient } from 'core/api';
79+
+ import { graphql } from '#core/api';
8080
import { Hotel } from './hotel.api-model';
81-
import { Lookup } from 'common/models';
81+
import { Lookup } from '#common/models';
8282

8383
const hotelListUrl = '/api/hotels';
8484
const cityListUrl = '/api/cities';
@@ -120,7 +120,7 @@ export const getHotel = async (id: string): Promise<Hotel> => {
120120
121121
- Let's implement save hotel. We will create an [input](https://graphql.org/learn/schema/#input-types) type to model hotel editing fields:
122122

123-
### ./server/src/graphql/type-defs.ts
123+
### ./server/src/graphql/schema.ts
124124

125125
```diff
126126
...
@@ -276,7 +276,7 @@ export const saveHotel = async (hotel: Hotel): Promise<boolean> => {
276276

277277
- Migrate `getCities` to GraphQL.
278278

279-
### ./server/src/graphql/type-defs.ts
279+
### ./server/src/graphql/schema.ts
280280

281281
```diff
282282
...

0 commit comments

Comments
 (0)