Skip to content

Named queries without variables support#4028

Merged
2 commits merged intomasterfrom
harshil-goel/named-queries
Sep 20, 2019
Merged

Named queries without variables support#4028
2 commits merged intomasterfrom
harshil-goel/named-queries

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost 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

@ghost ghost requested a review from manishrjain as a code owner September 19, 2019 13:29
@ghost ghost self-requested a review September 19, 2019 13:29
Copy link
Copy Markdown

@hackerone-code hackerone-code 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
Copy Markdown

@hackerone-code hackerone-code 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
Copy Markdown
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 { ... }

@ghost ghost merged commit 89017ea into master Sep 20, 2019
@ghost ghost deleted the harshil-goel/named-queries branch September 20, 2019 07:32
This pull request was closed.
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