Important:
Retrieves a list of items based on the provided filtering, sorting, and paging preferences.
function queryDataItems(
payload: QueryDataItemsEnvelope,
): QueryDataItemsResponse | Promise<QueryDataItemsResponse>;
import { externalDatabase } from "@wix/data/service-plugins";
externalDatabase.provideHandlers({
queryDataItems: async (payload) => {
const { request, metadata } = payload;
// Use the `request` and `metadata` received from Wix and
// apply custom logic.
return {
// Return your response exactly as documented to integrate with Wix.
// Return value example:
items: [
{
name: "New York",
_id: "c285e77c-a86b-4361-a55f-c6b934d70187",
population: 8300000.0,
country: "US",
isCapital: false,
},
],
pagingMetadata: {
total: 1,
},
};
},
});