bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
67 lines (55 loc) • 1.17 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _bluebird() {
const data = require("bluebird");
_bluebird = function () {
return data;
};
return data;
}
function _core() {
const data = require("@graphql-modules/core");
_core = function () {
return data;
};
return data;
}
var _default = workspace => {
return new (_core().GraphQLModule)({
typeDefs: `
type Workspace {
path: String
components: [Component]
}
type Component {
id: String
}
type Query {
workspace: Workspace
}
`,
resolvers: {
Component: {
id: component => component.id.toString()
},
Workspace: {
path: ws => ws.path,
components: function () {
var _ref = (0, _bluebird().coroutine)(function* (ws) {
return ws.list();
});
return function components(_x) {
return _ref.apply(this, arguments);
};
}()
},
Query: {
workspace: () => workspace
}
}
});
};
exports.default = _default;
;