Skip to content

Commit

Permalink
Remove graphql flags from all the commands that don't need it
Browse files Browse the repository at this point in the history
  • Loading branch information
macmv committed Sep 28, 2023
1 parent 2aa9cf6 commit c188d11
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
51 changes: 29 additions & 22 deletions src/commands/upload-graphql-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ const path = require("path");
class UploadGraphQLSchemaCommand extends FaunaCommand {
allowedExt = [".graphql", ".gql"];

static description = "Upload GraphQL schema";

static examples = [
"$ fauna upload-graphql-schema ./schema.gql",
"$ fauna upload-graphql-schema ./schema.gql --mode override",
];

static args = {
graphqlFilePath: Args.string({
required: true,
description: "Path to GraphQL schema",
}),
};

static flags = {
...FaunaCommand.flags,
graphqlHost: Flags.string({
description: "The Fauna GraphQL API host",
}),
graphqlPort: Flags.string({
description: "GraphQL port",
}),
mode: Flags.string({
description: "Upload mode",
default: "merge",
options: ["merge", "override", "replace"],
}),
};

async run() {
try {
const { graphqlFilePath } = this.args;
Expand Down Expand Up @@ -40,26 +69,4 @@ class UploadGraphQLSchemaCommand extends FaunaCommand {
}
}

UploadGraphQLSchemaCommand.description = "Upload GraphQL schema";

UploadGraphQLSchemaCommand.examples = [
"$ fauna upload-graphql-schema ./schema.gql",
"$ fauna upload-graphql-schema ./schema.gql --mode override",
];

UploadGraphQLSchemaCommand.args = {
graphqlFilePath: Args.string({
required: true,
description: "Path to GraphQL schema",
}),
};

UploadGraphQLSchemaCommand.flags = {
...FaunaCommand.flags,
mode: Flags.string({
description: "Upload mode",
default: "merge",
options: ["merge", "override", "replace"],
}),
};
module.exports = UploadGraphQLSchemaCommand;
6 changes: 0 additions & 6 deletions src/lib/fauna-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,6 @@ FaunaCommand.flags = {
endpoint: Flags.string({
description: "Fauna server endpoint",
}),
graphqlHost: Flags.string({
description: "The Fauna GraphQL API host",
}),
graphqlPort: Flags.string({
description: "GraphQL port",
}),
};

export default FaunaCommand;

0 comments on commit c188d11

Please sign in to comment.