Skip to content

Multiple types named "PageInfo" #27

@philipp-schmidt

Description

@philipp-schmidt

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions