var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import { gql } from '@apollo/client/index.js';
const RESERVE = gql `query RESERVE($count: Int!) { reserve(count: $count) { ids } }`;
export function reserve(options) {
    var _a, _b;
    return __awaiter(this, void 0, void 0, function* () {
        const result = yield options.client.query({
            query: RESERVE, variables: { count: options.count },
        });
        const ids = ((_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.reserve) === null || _b === void 0 ? void 0 : _b.ids) || [];
        return ids;
    });
}
//# sourceMappingURL=reserved.js.map