//native
/**
* Query More
* Fetch the next page of a SOQL result set using the nextRecordsUrl returned by Execute SOQL Query.
*/
export async function main(auth: RT.Salesforce, next_records_url: string) {
const url = new URL(`${auth.instance_url}${next_records_url}`)
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 9 days ago