@@ -26,7 +26,7 @@ export const typeDefs = `
2626 comments(filter: CommentFilter): CommentTypeConnection!
2727 tariffOption(id: ID!): TariffOption!
2828 tariffOptions(filter: TariffOptionFilter): TariffOptionTypeConnection!
29- tariff(id: ID !): Tariff!
29+ tariff(uuid: String !): Tariff!
3030 tariffs(filter: TariffFilter): TariffTypeConnection!
3131 tariffTariffOption(id: ID!): TariffTariffOption!
3232 tariffTariffOptions(filter: TariffTariffOptionFilter): TariffTariffOptionTypeConnection!
@@ -46,7 +46,7 @@ export const typeDefs = `
4646 deleteVideo(id: ID!): Video!
4747 deleteComment(id: ID!): Comment!
4848 deleteTariffOption(id: ID!): TariffOption!
49- deleteTariff(id: ID !): Tariff!
49+ deleteTariff(uuid: String !): Tariff!
5050
5151 createUser(user: UserInput!): User!
5252 createProfile(profile: ProfileInput!): Profile!
@@ -62,7 +62,7 @@ export const typeDefs = `
6262 updateVideo(id: ID!, video: VideoInput!): Video!
6363 updateComment(id: ID!, comment: CommentInput!): Comment!
6464 updateTariffOption(id: ID!, tariffOption: TariffOptionInput!): TariffOption!
65- updateTariff(id: ID !, tariff: TariffInput!): Tariff!
65+ updateTariff(uuid: String !, tariff: TariffInput!): Tariff!
6666
6767 upvotePost(captchaToken: String!, id: ID!): Post!
6868 sendSms(to: String!, text: String!): SmsStatus!
@@ -282,7 +282,7 @@ export const typeDefs = `
282282
283283
284284 type Tariff {
285- id: ID
285+ uuid: String
286286 name: String!
287287 displayName: String
288288 tariffType: String
@@ -292,7 +292,7 @@ export const typeDefs = `
292292
293293
294294 input TariffFilter {
295- id: ID
295+ uuid: String
296296 name: String
297297 displayName: String
298298 tariffType: String
@@ -301,7 +301,7 @@ export const typeDefs = `
301301
302302
303303 input TariffInput {
304- id: ID
304+ uuid: String
305305 name: String
306306 displayName: String
307307 tariffType: String
@@ -315,19 +315,19 @@ export const typeDefs = `
315315
316316
317317 type TariffTariffOption {
318- tariffId: ID
318+ tariffUuid: String
319319 tariffOptionId: ID
320320 }
321321
322322
323323 input TariffTariffOptionFilter {
324- tariffId: ID
324+ tariffUuid: String
325325 tariffOptionId: ID
326326 }
327327
328328
329329 input TariffTariffOptionInput {
330- tariffId: ID
330+ tariffUuid: String
331331 tariffOptionId: ID
332332 }
333333
@@ -526,23 +526,23 @@ const comments = [
526526
527527const tariffs = [
528528 {
529- id : 1 ,
529+ uuid : "ED5F2379-6A8B-4E1D-A4E3-A2C03057C2FC" ,
530530 name : "Super DSL S" ,
531531 displayName : "super-dsl-s" ,
532532 tariffType : "dsl" ,
533533 slug : "1as8d8w6iu"
534534 } ,
535535
536536 {
537- id : 2 ,
537+ uuid : "0D32575B-B15A-4949-95A0-73E6BDD75F8F" ,
538538 name : "Super DSL M" ,
539539 displayName : "super-dsl-m" ,
540540 tariffType : "dsl" ,
541541 slug : "asd8e2c89"
542542 } ,
543543
544544 {
545- id : 3 ,
545+ uuid : "8E54BEB8-05F3-48A7-A917-405A13865B89" ,
546546 name : "Super DSL L" ,
547547 displayName : "super-dsl-l" ,
548548 tariffType : "dsl" ,
@@ -786,7 +786,7 @@ function findOne(
786786 filterFn = idOrFn ;
787787 } else {
788788 filterFn = ( r : any ) => {
789- return parseInt ( r . id , 10 ) === parseInt ( idOrFn , 10 ) ;
789+ return r . id . toString ( ) === idOrFn . toString ( ) ;
790790 } ;
791791 }
792792
@@ -810,7 +810,7 @@ export const resolvers = {
810810 posts : ( parent : any , { filter } : any ) => findMany ( Post , posts , filter ) ,
811811 comment : ( parent : any , { id } : any ) => findOne ( Comment , comments , id ) ,
812812 comments : ( parent : any , { filter } : any ) => findMany ( Comment , comments , filter ) ,
813- tariff : ( parent : any , { id } : any ) => findOne ( Tariff , tariffs , id ) ,
813+ tariff : ( parent : any , { uuid } : any ) => findOne ( Tariff , tariffs , uuid ) ,
814814 tariffs : ( parent : any , { filter } : any ) => findMany ( Tariff , tariffs , filter ) ,
815815 tariffOption : ( parent : any , { id } : any ) => findOne ( TariffOption , tariffOptions , id ) ,
816816 tariffOptions : ( parent : any , { filter } : any ) => findMany ( TariffOption , tariffOptions , filter ) ,
0 commit comments