graphql-inspector icon indicating copy to clipboard operation
graphql-inspector copied to clipboard

audit command doesn't work with ci package

Open shawnjones253 opened this issue 11 months ago • 0 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • [ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run pnpm generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • [ ] 2. A failing test has been provided
  • [ ] 3. A local solution has been provided
  • [ ] 4. A pull request is pending review

Describe the bug

Following directions here, I'm trying to get graphql-inspector audit to work using just the CI package. When using @graphql-inspector/cli the command works, but when using @graphql-inspector/ci, @graphql-inspector/audit-command, and @graphql-inspector/code-loader, it produces no output.

To Reproduce Steps to reproduce the behavior: package.json

"
scripts": {
  "gql-audit": "graphql-inspector audit './src/**/!(*.test).(ts|tsx)'"
},
"dependencies": {
    "@graphql-inspector/audit-command": "^4.0.3",
    "@graphql-inspector/ci": "^4.0.3",
    "@graphql-inspector/code-loader": "^4.0.2",
    "@graphql-inspector/commands": "^4.0.3",
    "@graphql-inspector/graphql-loader": "^4.0.2",
    "@graphql-inspector/loaders": "^4.0.3",
    "graphql": "^16.8.1"
  }

someFile.tsx

import { gql } from '@apollo/client'

gql`
  query MyQuery {
    myField
  }

No output

yarn gql-audit
$ graphql-inspector audit './src/**/!(*.test).(ts|tsx)'
✨  Done in 0.38s.

I even tried installing all the command packages and loader packages, no dice.

Finally, if I install @graphql-inspector/cli, everything works as expected.

Expected behavior Audit output

Environment:

  • OS: mac 14.2
  • @graphql-inspector/...: versions above in package.json example
  • graphql: in package.json example
  • NodeJS: 20.4

Additional context

shawnjones253 avatar Mar 15 '24 07:03 shawnjones253