Skip to content

fix(GraphQL): This PR addd input coercion from single object to list and fix panic when we pass single ID in filter as a string. #7133 #7306

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

Merged
merged 3 commits into from
Jan 15, 2021

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Jan 15, 2021

Fixes GRAPHQL-745
Filter with id as a string was giving panic because we were expecting it to be of ["0x1"] type.

query {
       queryAuthor(filter:{id: "0x1"}) {
         name
         }
       }

So, we added input coercion such that if we require an object of type list and the input object is scalar then we coerce it to list.
(cherry picked from commit 5e5f5ca)


This change is Reviewable

JatinDev543 and others added 2 commits January 15, 2021 12:44
…and fix panic when we pass single ID in filter as a string. (#7133)

Fixes GRAPHQL-745
Filter with id as a string was giving panic because we were expecting it to be of ["0x1"] type.

 query {
        queryAuthor(filter:{id: "0x1"}) {
          name
          }
        }
So, we added input coercion such that if we require an object of type list and the input object is scalar then we coerce it to list.

(cherry picked from commit 5e5f5ca)
@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Jan 15, 2021
@JatinDev543 JatinDev543 merged commit fa85ff9 into release/v20.11 Jan 15, 2021
@JatinDev543 JatinDev543 deleted the jatin/cherryPick-InputArrayCoercion branch January 15, 2021 10:04
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