Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema fails at getRelatedType if table name and foreign key #72

Open
vaibhav-praeeo opened this issue May 9, 2019 · 0 comments
Open

Comments

@vaibhav-praeeo
Copy link

Schema fails at getRelatedType if table name and foreign key.

Suppose you have table name m_oraganization and primary key id
and then you have foreign key organization_id in m_discount_type

at name conversion
exports.getRelatedType = fieldName =>
getTypeFromKey(fieldName.substr(0, fieldName.length - 3));
substr strips down last three and we get Organization which actually doesn't exist.

UnhandledPromiseRejectionWarning: Error: Unknown type "Organization". Did you mean "MOrganization", "MRelation", or "MOrganizationFilter"?

Please suggest any other logic to handle related type names. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants