From 7ff22f613747b4642b211950e318f2780a302df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lytek?= Date: Sat, 1 Aug 2020 17:19:01 +0200 Subject: [PATCH] docs(examples): update generic types and inheritance constraints --- examples/generic-types/paginated-response.type.ts | 8 +++++--- .../resolvers-inheritance/resource/resource.resolver.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/generic-types/paginated-response.type.ts b/examples/generic-types/paginated-response.type.ts index 693e4fbaa..948c52847 100644 --- a/examples/generic-types/paginated-response.type.ts +++ b/examples/generic-types/paginated-response.type.ts @@ -1,11 +1,13 @@ import { ClassType, Field, ObjectType, Int } from "../../src"; -export default function PaginatedResponse(TItemClass: ClassType) { +export default function PaginatedResponse( + itemsFieldValue: ClassType | String | Number | Boolean, +) { // `isAbstract` decorator option is mandatory to prevent registering in schema @ObjectType({ isAbstract: true }) abstract class PaginatedResponseClass { - @Field(type => [TItemClass]) - items: TItem[]; + @Field(type => [itemsFieldValue]) + items: TItemsFieldValue[]; @Field(type => Int) total: number; diff --git a/examples/resolvers-inheritance/resource/resource.resolver.ts b/examples/resolvers-inheritance/resource/resource.resolver.ts index 47bc52aa5..7e388b88c 100644 --- a/examples/resolvers-inheritance/resource/resource.resolver.ts +++ b/examples/resolvers-inheritance/resource/resource.resolver.ts @@ -25,7 +25,7 @@ export class GetAllArgs { } export function ResourceResolver( - ResourceCls: ClassType, + ResourceCls: ClassType, resources: TResource[], ) { const resourceName = ResourceCls.name.toLocaleLowerCase();