Skip to content

npx @gqty/cli doesn't install gqty in package.json #2241

@zshall

Description

@zshall

Running the CLI based off the quick start in a Svelte project doesn't install gqty, thus the generated client can't find the gqty module. Since the default source location for the client is gqty/index.ts it made me think that files were missing in the generated directory, rather than needing a separate npm package.Running npm i gqty manually got me past the error.

Steps to reproduce:

$ npx @gqty/cli
✔ Where is your GraphQL endpoint or schema files? http://localhost/graphql
✔ Schema introspection completed.
✔ Pick the frontend frameworks in use:
✔ Do you need a subscription client? (Enter "-" to skip)
✔ Do you want a TypeScript client over vanilla.js? Yes
✔ Where should the client be generated? src/lib/gqty/index.ts
✔ Code generation completed.      
✔ Do you want us to run "npm install" for you? Yes

Expected result:

gqty is installed in my package.json

Actual result:

gqty isn't installed and there's an error in the generated client saying it can't find the module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions