Closed ValentinVignal closed 1 year ago
I see it is possible to provide a connectionName
to the ReadResolverOpts<DTO>
:
read: {
connectionName: 'TodoItemOffsetConnection',
one: { disabled: true },
many: {
name: 'todoItemOffset',
},
},
but it is being overridden in https://github.com/TriPSs/nestjs-query/blob/6f58030695cfb774d591cc2af2910ebc1e115f03/packages/query-graphql/src/resolvers/read.resolver.ts#L61
For the ones looking for a workaround, I managed to got both by doing:
resolvers: [
{
DTOClass: TodoItemDTO,
EntityClass: TodoItemEntity,
create: { disabled: true },
update: { disabled: true },
delete: { disabled: true },
read: {
one: { disabled: true },
many: {
name: 'todoItemCursor',
},
},
},
{
DTOClass: TodoItemDTO,
dtoName: 'TodoItemOffsetPaginated',
EntityClass: TodoItemEntity,
pagingStrategy: PagingStrategies.OFFSET,
create: { disabled: true },
update: { disabled: true },
delete: { disabled: true },
read: {
one: { disabled: true },
many: {
name: 'todoItemOffset',
},
},
},
],
But I think this issue should stay open as connectionName
doesn't seem to do anything because it always overridden
Hi @ValentinVignal, thanks for reporting, will try to check this out soon.
@TriPSs I wouldn't mind trying to work on this, I sent you a message for some help/advices
@ValentinVignal that would be awesome, thanks! Let me know if you need any help.
How should I contact you if I have some questions ?
You can comment here or if you have a more general question inside discussions, I receive emails for all notifications and tend to reply when I see them :)
@ValentinVignal FYI: I also created a slack (See README), let's see if that works.
Describe the bug
I have an entity
todo-item
, and I'm trying to create 2 resolvers:Have you read the Contributing Guidelines?
Yes
To Reproduce Steps to reproduce the behavior:
npm run start
Expected behavior
I would want to have 2 resolvers, one with cursor pagination and one with offset pagination.
Current behavior
Instead I get the error:
Desktop (please complete the following information):
I tried to see if there was a way to give a custom name to the connections, but I couldn't find it. Maybe a
connectionName
parameter could be added somewhere so I could specifyconnectionName: 'TodoItemCusorConnection'
andconnectionName: 'TodoItemOffsetConnection'