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

dangerouslyGetAll and double quotes in fulltext predicate #314

Open
cpatti97100 opened this issue Jul 28, 2023 · 1 comment · May be fixed by #315
Open

dangerouslyGetAll and double quotes in fulltext predicate #314

cpatti97100 opened this issue Jul 28, 2023 · 1 comment · May be fixed by #315
Labels
bug Something isn't working

Comments

@cpatti97100
Copy link

Versions

  • @prismicio/client: v6.7.3
  • node: v18.16.0

Reproduction

Additional Details

Steps to reproduce

try {
    const text = '"some"' // a string in double quotes can come from a user input
    const response = await client.dangerouslyGetAll({
      predicates: [
        prismic.predicate.fulltext('document', text),
      ],
    })

    return response
  } catch (error) {
    console.debug(error)
  }

What is expected?

I expect the client to return results just like it happens when passing a string with single quotes

What is actually happening?

ParsingError: ']' expected but '[' found on line:1 col:2 in query '[[fulltext(document, ""some"")]]'
[[fulltext(document, ""some"")]]
 ^

    at Client.fetch (file:///Users/.../node_modules/@prismicio/client/dist/client.js:403:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.get (file:///Users/.../node_modules/@prismicio/client/dist/client.js:96:12)
    at async Client.dangerouslyGetAll (file:///Users/.../node_modules/@prismicio/client/dist/client.js:123:22)
@cpatti97100 cpatti97100 added the bug Something isn't working label Jul 28, 2023
@github-actions
Copy link

This issue has been labeled as a bug since it was created using the 🚨 Bug Report Template.

Hi there, thank you so much for the report!

Following our Maintenance Process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:

  • Information about your environment and packages you use (Node.js version, package names and their versions, etc.)
    Feel free to attach a copy of your package.json file.
  • Any troubleshooting steps you already went through
  • A minimal reproduction of the issue, and/or instructions on how to reproduce it

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request addressing it. Check out our quick start guide for a simple contribution process.

If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io

- The Prismic Open-Source Team

@angeloashmore angeloashmore linked a pull request Aug 4, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant