This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Single character literals do not work #24
Labels
Comments
I am also unable to request an empty string e.g.
Maybe this has the same underlying problem, if not, let me know. Then i can raise a different issue. |
GQL uses single quotes for strings and doesn't recognise your double quotes, hence the error. |
Single quotes didn't work either, tested both. |
aileen
added a commit
to aileen/Ghost
that referenced
this issue
Feb 27, 2018
closes TryGhost#9085 Fixes an issue, where the client sets image properties to `""` after deleting the image. This causes problems with the query filter (see TryGhost/GQL#24), as they have to be `null`. Added a check in the model layer saving method to set value to `null`, when the property is empty. Affected models and properties: - `posts`: - `feature_image` - `og_image` - `twitter_image` - `users`: - `profile_image` - `cover_image` - `tags`: - `feature_image`
kirrg001
pushed a commit
to TryGhost/Ghost
that referenced
this issue
Mar 5, 2018
closes #9085 Fixes an issue, where the client sets image properties to `""` after deleting the image. This causes problems with the query filter (see TryGhost/GQL#24), as they have to be `null`. Added a check in the model layer saving method to set value to `null`, when the property is empty. Affected models and properties: - `posts`: - `feature_image` - `og_image` - `twitter_image` - `users`: - `profile_image` - `cover_image` - `tags`: - `feature_image`
This was referenced Mar 1, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Originally reported in TryGhost/Ghost#8433
To reproduce:
a
. Publish the post.ab
. Publish the post.http://localhost:2368/ghost/api/v0.1/posts?client_id=ghost-frontend&client_secret=[client-secret]&filter=slug:ab
- see that it workshttp://localhost:2368/ghost/api/v0.1/posts?client_id=ghost-frontend&client_secret=[client-secret]&filter=slug:a
- see that it doesn't workI believe this is due to the plus sign here: https://github.com/TryGhost/GQL/blob/master/src/gql.l#L22
The badcharsincnot regex matches a single character, and then the second group matches a second character. Therefore there must be at least 2 chars for a match.
Fixing this may have other implications, if so, we should close this issue and instead, add a rule that literals must be at least 2 characters to the documentation, provide tests to demo this limitation + if possible, improve the error message.
The text was updated successfully, but these errors were encountered: