WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

dangerouslyGetAll and double quotes in fulltext predicate #314

@cpatti97100

Description

@cpatti97100

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions