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

Named queries without variables support #4028

Merged
merged 2 commits into from
Sep 20, 2019

Conversation

harshil-goel
Copy link
Contributor

@harshil-goel harshil-goel commented Sep 19, 2019

Added support for queries with empty named queries

query works() {
  q(func: has(name)) {
    name
  }
}

Fixes #3994


This change is Reviewable

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ A review job has been created and sent to the PullRequest network.


@harshil-goel you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

This looks satisfactory for #3994


Reviewed with ❤️ by PullRequest

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

@mangalaman93 : Please approve using the reviewable interface. Otherwise, it is hard to know that you indeed reviewed it.

:lgtm: Got a comment about adding another test. Add that and merge.

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @harshil-goel)


gql/parser_test.go, line 57 at r1 (raw file):

func TestParseQueryNamedQuery(t *testing.T) {
	query := `
query works() {

Add another test for when works doesn't have round brackets.

query works { ... }

@harshil-goel harshil-goel merged commit 89017ea into master Sep 20, 2019
@harshil-goel harshil-goel deleted the harshil-goel/named-queries branch September 20, 2019 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Named queries without variables don't parse
3 participants