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): Fix getType queries when id was used as a name for types other than ID #6130

Merged
merged 4 commits into from
Aug 6, 2020

Conversation

pawanrawal
Copy link
Contributor

@pawanrawal pawanrawal commented Aug 4, 2020

For the schema

type Tweets {
	id: String! @id
	score: Int
}

getTweets query was not being properly re-written. This is because we were using the name id to signify that a field is of type ID instead of the type ID itself. That has been fixed now. So getTweets would work if the field was named anything.

query MyQuery {
  getTweets(id: "1286891968727982081") {
    score
    id
  }
}

This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Aug 4, 2020
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_strong:

Just a minor comment for the wording of the PR description.

So getTweets would work if the field was named anything other than id.

So getTweets would work if the field was named anything, even id.

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

@pawanrawal pawanrawal merged commit bb8e4b9 into master Aug 6, 2020
@pawanrawal pawanrawal deleted the pawanrawal/fix-get-queries-id-bug branch August 6, 2020 12:20
JatinDev543 pushed a commit that referenced this pull request Aug 13, 2020
…s other than ID (#6130)

For the schema

type Tweets {
	id: String! @id
	score: Int
}

getTweets query was not being properly re-written. This is because we were using the name id to signify that a field is of type ID instead of the type ID itself. That has been fixed now. So getTweets would work if the field was named anything.

query MyQuery {
  getTweets(id: "1286891968727982081") {
    score
    id
  }
}

(cherry picked from commit bb8e4b9)
JatinDev543 added a commit that referenced this pull request Aug 14, 2020
…s other than ID (#6130) (#6180)

For the schema

type Tweets {
	id: String! @id
	score: Int
}

getTweets query was not being properly re-written. This is because we were using the name id to signify that a field is of type ID instead of the type ID itself. That has been fixed now. So getTweets would work if the field was named anything.

query MyQuery {
  getTweets(id: "1286891968727982081") {
    score
    id
  }
}

(cherry picked from commit bb8e4b9)

Co-authored-by: Pawan Rawal <[email protected]>
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