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

Mis-parsing GraphQL identifiers when it starts with keywords (fix #20) #21

Merged
merged 12 commits into from Feb 24, 2020

Conversation

sordina
Copy link
Contributor

@sordina sordina commented Feb 20, 2020

Related Issues:

Ensures that primitive identifiers end rather than appear as a prefix of a broader identifier, ala nullColumnTwo.

Unit-tests added to ensure that the issue does not re-occur.

Currently, the implementation may be inefficient due to lookup of char-class:

identChars :: String
identChars = ['a'..'z'] ++ ['A'..'Z'] ++ ['0'..'9'] ++ "_"

This could also be wrong!

Ideally lexing and parsing will be separated and lexing can be compared to the syntax spec more easily.

@sordina sordina changed the title WIP: Mis-parsing Column Identifiers in on-conflict clause (#20) Mis-parsing Column Identifiers in on-conflict clause (#20) Feb 24, 2020
@sordina
Copy link
Contributor Author

sordina commented Feb 24, 2020

@ecthiender can you review? Once this has been passed I'll be able to reference from graphql-engine.

@sordina sordina changed the title Mis-parsing Column Identifiers in on-conflict clause (#20) Mis-parsing Column Identifiers in on-conflict clause (fixes #20) Feb 24, 2020
@@ -0,0 +1,45 @@
{-# LANGUAGE OverloadedStrings #-}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name of the file should be PrimitiveColumns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think we should call it something else. It is not really related to columns, but primitive values of GraphQL.

package.yaml Outdated
@@ -78,6 +78,7 @@ benchmarks:
tests:
graphql-parser-test:
main: Spec.hs
other-modules: PrimitiveColumns
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the hspec format, I don't think we have to include them like this. Do you think this is necessary?

Copy link
Member

@ecthiender ecthiender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some minor comments. Otherwise looks good to me!

@ecthiender ecthiender changed the title Mis-parsing Column Identifiers in on-conflict clause (fixes #20) Mis-parsing GraphQL identifiers when it starts with keywords (fix #20) Feb 24, 2020
Copy link
Member

@ecthiender ecthiender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ecthiender ecthiender merged commit 1380495 into hasura:master Feb 24, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants