Skip to content

Count returns not the total count but the count of returned results #45

@lishine

Description

@lishine

I mean if the limit=5 and results length is 5, count = 5
Is it intended?
What I expect is count = number of filtered rows without limit

    type Order @model(table: "orders", pk: "id") {
        id: ID!
        clientId: ID!
        clientUserId: ID!
        createdAt: String
        status: String
        paymentId: String
        amount: String
        productCode: String
        quantity: String
    }

    type Query @sqlmancer(dialect: POSTGRES, transformFieldNames: SNAKE_CASE) {
        hello(name: String): String
        isAuth: AuthPayload!
        orders: Order @many @paginate
    }
        async orders(_, __, { sql, client }, info) {
            isAuth
            return client.models.Order.paginate().count().selectAll().resolveInfo(info).execute()
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions