( className, where, order, skipInput, first, after, last, before, keys, include, includeAll, readPreference, includeReadPreference, subqueryReadPreference, config, auth, info, selectedFields, parseClasses )
| 85 | }; |
| 86 | |
| 87 | const findObjects = async ( |
| 88 | className, |
| 89 | where, |
| 90 | order, |
| 91 | skipInput, |
| 92 | first, |
| 93 | after, |
| 94 | last, |
| 95 | before, |
| 96 | keys, |
| 97 | include, |
| 98 | includeAll, |
| 99 | readPreference, |
| 100 | includeReadPreference, |
| 101 | subqueryReadPreference, |
| 102 | config, |
| 103 | auth, |
| 104 | info, |
| 105 | selectedFields, |
| 106 | parseClasses |
| 107 | ) => { |
| 108 | if (!where) { |
| 109 | where = {}; |
| 110 | } |
| 111 | transformQueryInputToParse(where, className, parseClasses); |
| 112 | const skipAndLimitCalculation = calculateSkipAndLimit( |
| 113 | skipInput, |
| 114 | first, |
| 115 | after, |
| 116 | last, |
| 117 | before, |
| 118 | config.maxLimit |
| 119 | ); |
| 120 | let { skip } = skipAndLimitCalculation; |
| 121 | const { limit, needToPreCount } = skipAndLimitCalculation; |
| 122 | let preCount = undefined; |
| 123 | if (needToPreCount) { |
| 124 | const preCountOptions = { |
| 125 | limit: 0, |
| 126 | count: true, |
| 127 | }; |
| 128 | if (readPreference) { |
| 129 | preCountOptions.readPreference = readPreference; |
| 130 | } |
| 131 | if (Object.keys(where).length > 0 && subqueryReadPreference) { |
| 132 | preCountOptions.subqueryReadPreference = subqueryReadPreference; |
| 133 | } |
| 134 | preCount = ( |
| 135 | await rest.find(config, auth, className, where, preCountOptions, info.clientSDK, info.context) |
| 136 | ).count; |
| 137 | if ((skip || 0) + limit < preCount) { |
| 138 | skip = preCount - limit; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | const options = {}; |
| 143 | |
| 144 | if (selectedFields.find(field => field.startsWith('edges.') || field.startsWith('pageInfo.'))) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…