Skip to content

Commit 6adf0a9

Browse files
authored
Merge pull request #14 from dgraph-io/jatin/Fix-stringError
fix(GraphQL): fix error while validation when we give Int or Float to String.
2 parents 6c9552e + 0488d0a commit 6adf0a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validator/vars.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (v *varValidator) validateVarType(typ *ast.Type, val reflect.Value) (reflec
197197
// assume custom scalars are ok
198198
return val, nil
199199
}
200-
return val, gqlerror.ErrorPathf(v.path, "cannot use %s as %s", kind.String(), typ.NamedType)
200+
return val, gqlerror.ErrorPathf(v.path, "cannot use %s as %s", namedType, typ.NamedType)
201201
case ast.InputObject:
202202
if val.Kind() != reflect.Map {
203203
return val, gqlerror.ErrorPathf(v.path, "must be a %s", def.Name)

0 commit comments

Comments
 (0)