Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Command doesn't show in which file we are querying the deprecated field #2684

Open
4 tasks
MeetM15 opened this issue Jan 11, 2024 · 2 comments
Open
4 tasks

Comments

@MeetM15
Copy link

MeetM15 commented Jan 11, 2024

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

We are working on a nuxtjs project where we are using @graphql-codegen/cli to generate our schema and we are trying to use graphql-inspector for validating our documents so we can know if we are querying for any deprecated fields. But the issue we are facing is that the graphql-inspector validate Command detects the deprecated fields but doesn't show in which document we are querying the deprecated field. We have also added this in our CI/CD pipeline which is having the same result. Please provide a solution for this , thanks.

Command line screenshot of actual result:
image

To Reproduce Steps to reproduce the behavior:

Install these packages:

"@graphql-inspector/ci": "^4.0.3",
    "@graphql-inspector/graphql-loader": "^4.0.2",
    "@graphql-inspector/url-loader": "^4.0.2",
    "@graphql-inspector/validate-command": "^4.0.3",
Add this command to scripts section in package.json :
"graphql:inspect": "graphql-inspector validate \"./src/gql/**/*.graphql\" graphql-endpoint"

Run this script in command line

Expected behavior

It should list all the documents which has the deprecated fields in the query under Warning, This feature is already shown in the documentation , here is the screenshot of documentation for reference:
image

Environment:

  • OS: Windows 11
  • "@graphql-inspector/ci": "^4.0.3",
  • "@graphql-inspector/graphql-loader": "^4.0.2",
  • "@graphql-inspector/url-loader": "^4.0.2",
  • "@graphql-inspector/validate-command": "^4.0.3",
  • graphql:"^16.8.1"
  • NodeJS:"18.17.1"
@TuvalSimha
Copy link
Collaborator

TuvalSimha commented Jan 16, 2024

Hey @MeetM15,
thank you for this new issue.

I guess you find a solution? the path is wrong, have a redundant \

@MeetM15
Copy link
Author

MeetM15 commented Jan 17, 2024

Hey @MeetM15, thank you for this new issue.

I guess you find a solution? the path is wrong, have a redundant \

Hey ! Haven't found a solution yet , by path do you mean this \"./src/gql/**/*.graphql\ ? I think the path is fine because I tried removing quotes as well , also if I add the --deprecated flag it lists out files under errors , its not working only for the normal case without the flag.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants