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

Merged
merged 5 commits into from
Jan 21, 2021

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Jan 18, 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.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Jan 18, 2021
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

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

@JatinDev543 JatinDev543 changed the title fix(GraphQl):This PR fix a panic when we pass a single ID as a integer and coerce that to type array of string. 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. Jan 21, 2021
@netlify
Copy link

netlify bot commented Jan 21, 2021

Deploy preview for dgraph-docs ready!

Built with commit 6e7f64e

https://deploy-preview-7325--dgraph-docs.netlify.app

@JatinDev543 JatinDev543 merged commit 5fa6796 into master Jan 21, 2021
@JatinDev543 JatinDev543 deleted the GRAPHQL-959 branch January 21, 2021 15:48
JatinDev543 added a commit that referenced this pull request Jan 22, 2021
…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)
JatinDev543 added a commit that referenced this pull request Jan 22, 2021
…r and expected type is [ID].We now coerce that to type array of string. (#7325) (#7353)

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)
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