apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 468 forks source link

The CLI --help command doesn't work #2520

Open nirvdrum opened 2 years ago

nirvdrum commented 2 years ago

Intended outcome:

I was trying to figure out how to use the client:codegen subcommand. It directed me to use the --help option and no matter where I place it, I'm unable to get help output. I expected to see information about the command's flags, but instead received an error about a plugin.

Actual outcome:

> yarn apollo client:codegen
yarn run v1.22.17
$ /home/nirvdrum/dev/workspaces/taskerator/node_modules/.bin/apollo client:codegen
 ›   Error: Missing required flag:
 ›    --target TARGET  Type of code generator to use (swift | typescript | flow | scala | json | json-modern (exposes raw json types))
 ›   See more help with --help
error Command failed with exit code 2.
> yarn apollo client:codegen --help
yarn run v1.22.17
$ /home/nirvdrum/dev/workspaces/taskerator/node_modules/.bin/apollo client:codegen --help
    TypeError: plugin_help_1.getHelpClass is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

> yarn apollo --help client:codegen
yarn run v1.22.17
$ /home/nirvdrum/dev/workspaces/taskerator/node_modules/.bin/apollo --help client:codegen
    TypeError: plugin_help_1.getHelpClass is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

> yarn apollo --help
yarn run v1.22.17
$ /home/nirvdrum/dev/workspaces/taskerator/node_modules/.bin/apollo --help
    TypeError: plugin_help_1.getHelpClass is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How to reproduce the issue:

  1. Create a new JS project.
  2. Install apollo as a dev dependency (e.g., yarn add -D apollo)
  3. Run help command: yarn apollo --help

Please note that the issue can be reproduced using npm instead of yarn.

Versions

Apollo: 2.33.9