@@ -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
7878import Axios from 'axios';
79- + import { graphQLClient } from 'core/api';
79+ + import { graphql } from '# core/api';
8080import { Hotel } from './hotel.api-model';
81- import { Lookup } from 'common/models';
81+ import { Lookup } from '# common/models';
8282
8383const hotelListUrl = '/api/hotels';
8484const 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