Sorry about the noise... I create a Pull Request instead. See #183
I'm starting with express-cassandra and I got the following error
(node:13187) UnhandledPromiseRejectionWarning: apollo.model.validator.invalidschema: Invalid field type "undefined" for field: content_id
Looking at the code I see that the type can either be a field or a string;
get_field_type(modelSchema, fieldName) {
var fieldObject = modelSchema.fields[fieldName];
if (typeof fieldObject === 'string') {
return fieldObject;
}
if (_.isPlainObject(fieldObject)) {
return fieldObject.type;
}
throw new Error('Field type not defined properly');
},
However, in the code generating the error:
var fieldtype = this.get_field_type(modelSchema, fieldName);
if (!_.has(datatypes, fieldtype)) {
throw new Error(util.format('Invalid field type "%s" for field: %s', fieldObject.type, fieldName));
}
I suggest changing the fieldObject.type with fieldtype as follow:
throw new Error(util.format('Invalid field type "%s" for field: %s', fieldtype, fieldName));
Then I can see that it's not happen with 'long' as a field type:
(node:13187) UnhandledPromiseRejectionWarning: apollo.model.validator.invalidschema: Invalid field type "long" for field: content_id
Which is strange, but at least makes a lot more sense.
Sorry about the noise... I create a Pull Request instead. See #183
I'm starting with express-cassandra and I got the following error
Looking at the code I see that the type can either be a field or a string;
However, in the code generating the error:
I suggest changing the
fieldObject.type
withfieldtype
as follow:Then I can see that it's not happen with 'long' as a field type:
Which is strange, but at least makes a lot more sense.