import apollo from "../../lib/apollo.js";

async function GetDealers(filter, token="") {
	var res = await apollo.query(
        `
            query { ${(filter!="")?`name: "${filter}"`:""}
                dealers
                {
                    id
                    name
                    kota_dealer
                    address
                    telp
                    email
                    location
                }
            }
        `,
            token
	);
	return res;
}

module.exports = {
	GetDealers: GetDealers,
};