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

Fix(GraphQL): Change variable name generation from Type<Num> to Type_<Num> #7556

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

vmrajas
Copy link
Contributor

@vmrajas vmrajas commented Mar 11, 2021

Motivation:
While rewriting GraphQL queries and mutations to DQL, different variable names are used to generate query names, blank node names. Exam ple: While rewriting addProject mutation, the variable Project1 is used while writing existence queries. This is problematic as same variable name could get generated for two different nodes like Person1 + 1 and Person + 11, both generating Person11.

To avoid this, this PR adds _ in variable generation between type name and number.

Testing:
Added test to add_mutation_test.yaml

Fixes GRAPHQL-1079


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Mar 11, 2021
@vmrajas vmrajas changed the title Change variable name generation from Type<Num> to Type_<Num> Fix(GraphQL): Change variable name generation from Type<Num> to Type_<Num> Mar 11, 2021
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 15 of 15 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @pawanrawal)

@vmrajas vmrajas merged commit 74ff7cd into release/v21.03 Mar 12, 2021
@vmrajas vmrajas deleted the rajas/GRAPHQL-1079 branch March 12, 2021 06:21
aman-bansal pushed a commit that referenced this pull request Mar 15, 2021
…<Num> (#7556)

* Change variable name generation from Type<Num> to Type_<Num>

* Add yaml test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants