eas-cli
Version:
EAS command line tool
62 lines (61 loc) • 2.31 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeploymentsQuery = void 0;
const tslib_1 = require("tslib");
const graphql_1 = require("graphql");
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
const WorkerDeployment_1 = require("./fragments/WorkerDeployment");
const client_1 = require("../graphql/client");
exports.DeploymentsQuery = {
async getAllDeploymentsPaginatedAsync(graphqlClient, { appId, first, after, last, before }) {
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
.query((0, graphql_tag_1.default) `
query PaginatedWorkerDeployments(
$appId: String!
$first: Int
$after: String
$last: Int
$before: String
) {
app {
byId(appId: $appId) {
id
workerDeployments(first: $first, after: $after, last: $last, before: $before) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
id
...WorkerDeploymentFragment
}
}
}
}
}
}
${(0, graphql_1.print)(WorkerDeployment_1.WorkerDeploymentFragmentNode)}
`, { appId, first, after, last, before }, { additionalTypenames: ['WorkerDeployment'] })
.toPromise());
return data.app.byId.workerDeployments;
},
async getSuggestedDevDomainByAppIdAsync(graphqlClient, { appId }) {
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
.query((0, graphql_tag_1.default) `
query SuggestedDevDomainName($appId: String!) {
app {
byId(appId: $appId) {
id
suggestedDevDomainName
}
}
}
`, { appId }, { additionalTypenames: ['App'] })
.toPromise());
return data.app.byId.suggestedDevDomainName;
},
};
;