mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-20 06:09:56 -06:00
* fix(ui): chrome bug: grid element overflow https://bugs.chromium.org/p/chromium/issues/detail?id=833837 * feat(ui): dependencies view * feat(ui): filter deps
66 lines
1.6 KiB
JavaScript
66 lines
1.6 KiB
JavaScript
const gql = require('graphql-tag')
|
|
// Connectors
|
|
const cwd = require('../connectors/cwd')
|
|
const dependencies = require('../connectors/dependencies')
|
|
|
|
exports.types = gql`
|
|
extend type Query {
|
|
dependencies: [Dependency]
|
|
dependency (id: ID!): Dependency
|
|
}
|
|
|
|
extend type Mutation {
|
|
dependencyInstall (input: DependencyInstall!): Dependency
|
|
dependencyUninstall (input: DependencyUninstall!): Dependency
|
|
dependencyUpdate (input: DependencyUpdate!): Dependency
|
|
dependenciesUpdate: [Dependency]
|
|
}
|
|
|
|
type Dependency {
|
|
id: ID!
|
|
type: DependencyType!
|
|
version: Version!
|
|
installed: Boolean
|
|
website: String
|
|
description: String
|
|
githubStats: GitHubStats
|
|
}
|
|
|
|
enum DependencyType {
|
|
dependencies
|
|
devDependencies
|
|
}
|
|
|
|
input DependencyInstall {
|
|
id: ID!
|
|
type: DependencyType!
|
|
}
|
|
|
|
input DependencyUninstall {
|
|
id: ID!
|
|
}
|
|
|
|
input DependencyUpdate {
|
|
id: ID!
|
|
}
|
|
`
|
|
|
|
exports.resolvers = {
|
|
Dependency: {
|
|
version: (dependency, args, context) => dependencies.getVersion(dependency, context),
|
|
description: (dependency, args, context) => dependencies.getDescription(dependency, context)
|
|
},
|
|
|
|
Query: {
|
|
dependencies: (root, args, context) => dependencies.list(cwd.get(), context),
|
|
dependency: (root, { id }, context) => dependencies.findOne(id, context)
|
|
},
|
|
|
|
Mutation: {
|
|
dependencyInstall: (root, { input }, context) => dependencies.install(input, context),
|
|
dependencyUninstall: (root, { input }, context) => dependencies.uninstall(input, context),
|
|
dependencyUpdate: (root, { input }, context) => dependencies.update(input, context),
|
|
dependenciesUpdate: (root, args, context) => dependencies.updateAll(context)
|
|
}
|
|
}
|