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):This PR fix a panic when we pass a single ID as a integer and expected type is [ID].We now coerce that to type array of string. (#7325) #7353

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Jan 22, 2021

The following query was giving panic because here we passed ID as an int which is expected to be a string.


query allStories {
      queryUser(filter: {
        id: 22
      }) {
        stories {
          id
          text
        }
      }
    }

We now added input coercion so that the ID type value will be coerced to string type. And if we give a slice of integer values
to ID type variable then that will be coerced to slice of integer values.

(cherry picked from commit 5fa6796)


This change is Reviewable

…r and expected type is [ID].We now coerce that to type array of string. (#7325)

The following query was giving panic because here we passed ID as an int which is expected to be a string.

query allStories {
      queryUser(filter: {
        id: 22
      }) {
        stories {
          id
          text
        }
      }
    }

We now added input coercion so that the ID type value will be coerced to string type. And if we give a slice of integer values
to ID type variable then that will be coerced to slice of integer values.

(cherry picked from commit 5fa6796)
@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Jan 22, 2021
@JatinDev543 JatinDev543 merged commit a3eff77 into release/v20.11 Jan 22, 2021
@JatinDev543 JatinDev543 deleted the jatin/cherryPick-GRAPHQL-959 branch January 22, 2021 09:30
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