Request only needed fields
This commit is contained in:
parent
9e90103c12
commit
66857d0026
|
@ -1537,11 +1537,16 @@ class InternalBuilder {
|
||||||
limits?: { base: number; query: number }
|
limits?: { base: number; query: number }
|
||||||
} = {}
|
} = {}
|
||||||
): Knex.QueryBuilder {
|
): Knex.QueryBuilder {
|
||||||
let { operation, filters, paginate, relationships, table } = this.query
|
const { operation, filters, paginate, relationships, table, resource } =
|
||||||
|
this.query
|
||||||
const { limits } = opts
|
const { limits } = opts
|
||||||
|
|
||||||
// start building the query
|
// start building the query
|
||||||
let query = this.qualifiedKnex()
|
let query = this.qualifiedKnex()
|
||||||
|
if (resource?.fields) {
|
||||||
|
query = query.columns(resource?.fields)
|
||||||
|
}
|
||||||
|
|
||||||
// handle pagination
|
// handle pagination
|
||||||
let foundOffset: number | null = null
|
let foundOffset: number | null = null
|
||||||
let foundLimit = limits?.query || limits?.base
|
let foundLimit = limits?.query || limits?.base
|
||||||
|
|
Loading…
Reference in New Issue