{"action":"created","issue":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/1168","repository_url":"https://api.github.com/repos/Vincit/objection.js","labels_url":"https://api.github.com/repos/Vincit/objection.js/issues/1168/labels{/name}","comments_url":"https://api.github.com/repos/Vincit/objection.js/issues/1168/comments","events_url":"https://api.github.com/repos/Vincit/objection.js/issues/1168/events","html_url":"https://github.com/Vincit/objection.js/issues/1168","id":389808873,"node_id":"MDU6SXNzdWUzODk4MDg4NzM=","number":1168,"title":"$query().upsertGraph() uses old instance values","user":{"login":"sarneeh","id":11553624,"node_id":"MDQ6VXNlcjExNTUzNjI0","avatar_url":"https://avatars2.githubusercontent.com/u/11553624?v=4","gravatar_id":"","url":"https://api.github.com/users/sarneeh","html_url":"https://github.com/sarneeh","followers_url":"https://api.github.com/users/sarneeh/followers","following_url":"https://api.github.com/users/sarneeh/following{/other_user}","gists_url":"https://api.github.com/users/sarneeh/gists{/gist_id}","starred_url":"https://api.github.com/users/sarneeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarneeh/subscriptions","organizations_url":"https://api.github.com/users/sarneeh/orgs","repos_url":"https://api.github.com/users/sarneeh/repos","events_url":"https://api.github.com/users/sarneeh/events{/privacy}","received_events_url":"https://api.github.com/users/sarneeh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-11T15:08:55Z","updated_at":"2018-12-11T15:47:02Z","closed_at":"2018-12-11T15:47:02Z","author_association":"NONE","body":"The title actually says it all. Consider this example:\r\n\r\n```js\r\nconst person = await Person.findById({ id: 1 });\r\n// > console.log(person);\r\n// > { id: 1, name: \"John\" }\r\nawait person.$query().upsertGraph({ id: 1, name: 'Steve' }).debug();\r\n// > { method: 'update', bindings: ['John', 1], sql: 'update \"persons\" set \"name\" = ? where \"persons\".\"id\" = ?' }\r\n```\r\n\r\nAs you can notice - the `upsertGraph` doesn't take the new model into consideration and it just uses the old one. Am I missing something?"},"comment":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/comments/446250199","html_url":"https://github.com/Vincit/objection.js/issues/1168#issuecomment-446250199","issue_url":"https://api.github.com/repos/Vincit/objection.js/issues/1168","id":446250199,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjI1MDE5OQ==","user":{"login":"koskimas","id":846508,"node_id":"MDQ6VXNlcjg0NjUwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/846508?v=4","gravatar_id":"","url":"https://api.github.com/users/koskimas","html_url":"https://github.com/koskimas","followers_url":"https://api.github.com/users/koskimas/followers","following_url":"https://api.github.com/users/koskimas/following{/other_user}","gists_url":"https://api.github.com/users/koskimas/gists{/gist_id}","starred_url":"https://api.github.com/users/koskimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koskimas/subscriptions","organizations_url":"https://api.github.com/users/koskimas/orgs","repos_url":"https://api.github.com/users/koskimas/repos","events_url":"https://api.github.com/users/koskimas/events{/privacy}","received_events_url":"https://api.github.com/users/koskimas/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T15:47:02Z","updated_at":"2018-12-11T15:47:02Z","author_association":"COLLABORATOR","body":"`upsertGraph` is only meaningful when used with `query()`. This issue is covered by https://github.com/Vincit/objection.js/issues/933\r\n"}}
{"actor":{"display_login":"koskimas"}}