You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resolvers seem to have the following options:
DTOClass
EntityClass
CreateDTOClass
UpdateTDOClass
in our use-case for mutations (Create, Update) , we only queue the Create/Update request and return a DTO that is totally different from the DTOClass returned in queries, for example:
// regular Todo item DTO , should be returned for all queries
@ObjectType('TodoItem')
export class TodoItemDTO {
@IDField(() => ID)
id!: number;
@FilterableField()
title!: string;
}
// this should be returned for Create/Update
@ObjectType('CommandItem')
export class CommandItemDTO {
@IDField(() => ID)
id!: number; // this is a command ID that can be used to reference the status of the command
@FilterableField()
status!: string; // the command status could be "Pending" , "Completed" , etc...
}
so is there a way to return CommandItemDTO , but only in response to Create/Update?
it seems like even if we use custom resolvers , and/or assemblers , there is only one DTO return type
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
resolvers seem to have the following options:
DTOClass
EntityClass
CreateDTOClass
UpdateTDOClass
in our use-case for mutations (Create, Update) , we only queue the Create/Update request and return a DTO that is totally different from the DTOClass returned in queries, for example:
// regular Todo item DTO , should be returned for all queries
@ObjectType('TodoItem')
export class TodoItemDTO {
@IDField(() => ID)
id!: number;
@FilterableField()
title!: string;
}
// this should be returned for Create/Update
@ObjectType('CommandItem')
export class CommandItemDTO {
@IDField(() => ID)
id!: number; // this is a command ID that can be used to reference the status of the command
@FilterableField()
status!: string; // the command status could be "Pending" , "Completed" , etc...
}
so is there a way to return CommandItemDTO , but only in response to Create/Update?
it seems like even if we use custom resolvers , and/or assemblers , there is only one DTO return type
Thanks in advance for any help.
Beta Was this translation helpful? Give feedback.
All reactions