Check expected type is array from Parse Format Schema

This commit is contained in:
Drew Gross
2016-04-25 23:36:25 -07:00
parent 4371ca164c
commit 874d10fc74
2 changed files with 7 additions and 3 deletions

View File

@@ -195,7 +195,10 @@ function transformQueryKeyValue(schema, className, key, value, { validate } = {}
(!expected && value && value.__type == 'Pointer')) {
key = '_p_' + key;
}
const expectedTypeIsArray = (expected && expected.type === 'Array');
const expectedTypeIsArray =
parseFormatSchema &&
parseFormatSchema.fields[key] &&
parseFormatSchema.fields[key].type === 'Array'
// Handle query constraints
if (transformConstraint(value, expectedTypeIsArray) !== CannotTransform) {