Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as TypeScript by kostyan ( 5 years ago )
import { Field, ObjectType } from 'type-graphql';
export default interface IServiceResponse<T> {
data?: T;
errors?: IFieldError[];
}
@ObjectType()
export class FieldErrorGQL implements IFieldError {
@Field()
field: string;
@Field()
message: string;
}
@ObjectType()
export class RoomsResponse implements IServiceResponse<Room[]> {
@Field(() => [FieldErrorGQL], { nullable: true })
errors?: FieldErrorGQL[];
@Field(() => [Room], { nullable: true })
data?: Room[];
}
@ObjectType()
export class RoomResponse implements IServiceResponse<Room> {
@Field(() => [FieldErrorGQL], { nullable: true })
errors?: FieldErrorGQL[];
@Field(() => Room, { nullable: true })
data?: Room;
}
Revise this Paste