- fix in graphql type builder (#6075)

a required attribute that has a default value it's now not required in the input schema used for entities creation

Signed-off-by: Gadi Piperno Corcos <gadi@skyriseltd.com>

Co-authored-by: Gadi Piperno Corcos <gadi@skyriseltd.com>
This commit is contained in:
gp27 2020-07-16 08:45:44 +02:00 committed by GitHub
parent c587bda522
commit eb272e996c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,8 +71,10 @@ module.exports = {
break; break;
} }
if (attribute.required && action !== 'update') { if (attribute.required) {
type += '!'; if (rootType !== 'mutation' || (action !== 'update' && attribute.default === undefined)) {
type += '!';
}
} }
return type; return type;