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

Unbalanced braces in queries not causing parse-query to fail #445

Open
neilprosser opened this issue May 17, 2023 · 0 comments
Open

Unbalanced braces in queries not causing parse-query to fail #445

neilprosser opened this issue May 17, 2023 · 0 comments

Comments

@neilprosser
Copy link

This is tested with 1.2.1.

We use Lacinia to quickly validate GraphQL queries we define in code to try and avoid committing something invalid. I noticed a couple of examples of typos which don't cause com.walmartlabs.lacinia.parser.query/parse-query to fail:

(ns temp
  (:require [com.walmartlabs.lacinia.parser.query :as pq]))

;; Brace switched with paren end of line 1 - Throws an exception
(pq/parse-query "query (
  myQuery {
    name
  }
}")

;; Missing brace end of line 1 - Doesn't throw an exception
(pq/parse-query "query
  myQuery {
    name
  }
}")

;; Missing brace end of line 2 - Doesn't throw an exception
(pq/parse-query "query {
  myQuery
    name
  }
}")

These queries are then failing when they are sent to a service using Lacinia for its GraphQL handling.

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

No branches or pull requests

1 participant