Skip to content

Commit

Permalink
Merge pull request #14 from dgraph-io/jatin/Fix-stringError
Browse files Browse the repository at this point in the history
fix(GraphQL): fix error while validation when we give Int or Float to String.
  • Loading branch information
JatinDev543 authored Feb 26, 2021
2 parents 6c9552e + 0488d0a commit 6adf0a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validator/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (v *varValidator) validateVarType(typ *ast.Type, val reflect.Value) (reflec
// assume custom scalars are ok
return val, nil
}
return val, gqlerror.ErrorPathf(v.path, "cannot use %s as %s", kind.String(), typ.NamedType)
return val, gqlerror.ErrorPathf(v.path, "cannot use %s as %s", namedType, typ.NamedType)
case ast.InputObject:
if val.Kind() != reflect.Map {
return val, gqlerror.ErrorPathf(v.path, "must be a %s", def.Name)
Expand Down

0 comments on commit 6adf0a9

Please sign in to comment.