I'm having trouble creating a Relay'd Query like shown in this example.
My code is the following:
@Authorized([UserRole.ADMIN])
@RelayedQuery(() => User, { description: "Return all users. Permission: ADMIN." })
async allUsers(
@RelayLimitOffset() {limit, offset}: RelayLimitOffsetArgs
): Promise<[User[], number]> {
return await User.findAndCount({
skip: offset,
take: limit
});
}
I had to change Promise<[number, User[]]> to Promise<[User[], number]> because typeorm returns it the other way around, but I don't think thats the cause of the problem.
During startup I get the following error:
UnhandledPromiseRejectionWarning: Error: Schema must contain uniquely named types but contains multiple types named "PageInfo".
I have not touched other queries except the above. The only other additions I made are the configuration steps in index.ts.
Is this somehow linked to #16 and the undefinedPageInfo type? Am I missing something? Any help very much appreciated!
I'm having trouble creating a Relay'd Query like shown in this example.
My code is the following:
I had to change
Promise<[number, User[]]>toPromise<[User[], number]>because typeorm returns it the other way around, but I don't think thats the cause of the problem.During startup I get the following error:
I have not touched other queries except the above. The only other additions I made are the configuration steps in index.ts.
Is this somehow linked to #16 and the
undefinedPageInfo type? Am I missing something? Any help very much appreciated!