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 fails if "..." occurs within a string in a query #2695

Open
4 tasks
AccsoSG opened this issue Mar 4, 2024 · 0 comments
Open
4 tasks

Validate fails if "..." occurs within a string in a query #2695

AccsoSG opened this issue Mar 4, 2024 · 0 comments

Comments

@AccsoSG
Copy link

AccsoSG commented Mar 4, 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

I use the validate function in the code to find out if a client is using a deprecated field.
I have now noticed that the validate function throws an error if there is a triple dot in a string within the mutation. "..."

For example, the following mutation fails:

mutation createItems {
  createItems(
    input: [
      {
        name: "Test"
        description: "Test...Test"
      }
    ]
  ) {
    info {
      nodesCreated
    }
  }
}

I get the following error message:

{
  "errors": [
    {
      "message": "Node does not exist: Test",
    }
  ]
}

The problem occurs at the following point:
https://github.com/kamilkisiela/graphql-inspector/blob/master/packages/core/src/validate/index.ts#L120

To Reproduce Steps to reproduce the behavior:

Expected behavior
A triple dot within a string must not be recognized as a fragment. The validation may not fail.

Environment:

  • OS:
  • @graphql-inspector/core: 5.0.2
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

1 participant