-
Notifications
You must be signed in to change notification settings - Fork 362
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
not including foreignKey in relation fields crashes loopback app #890
Comments
Can you provide a sample repo for me to reproduce the issue on my end? |
hi superkhau, i'll package a sample loopback app and send it through |
You can fork loopback-sandbox with just some dummy data. See https://github.com/strongloop/loopback/wiki/Reporting-issues#bug-report |
see this sample repo to reproduce the issue: the sample has 2 models: parent and child with a hasOne relation from parent to child as per parent.json the relation is defaulted to
note the missing i created 2 boot scripts:
simply launch node . just add the i tested, it runs exactly the same if i don't include the relation and fields by default and specify them in the query |
This is a duplicate issue of #779 |
consider the following relation:
note that the channelId foreignKey is missing in the fields filter: this gives the following error which just crashes the loopback app
adding the foreignKey in the fields filter solves the issue
"fields": ["id", "channelId"]
This is nonsense the app crashes for such reason.
Better than fixing, would you consider forcing the foreignKeys by default in fields filter ?
in my case, the relation
would implicitly traduce as a
"fields": ["id", "channelId"]
filterThe text was updated successfully, but these errors were encountered: