{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/2584","labels_url":"https://api.github.com/repos/emberjs/data/issues/2584/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/2584/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/2584/events","html_url":"https://github.com/emberjs/data/pull/2584","id":51847100,"number":2584,"title":"Add queryOne method","user":{"login":"thaume","id":1096014,"avatar_url":"https://avatars.githubusercontent.com/u/1096014?v=3","gravatar_id":"","url":"https://api.github.com/users/thaume","html_url":"https://github.com/thaume","followers_url":"https://api.github.com/users/thaume/followers","following_url":"https://api.github.com/users/thaume/following{/other_user}","gists_url":"https://api.github.com/users/thaume/gists{/gist_id}","starred_url":"https://api.github.com/users/thaume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaume/subscriptions","organizations_url":"https://api.github.com/users/thaume/orgs","repos_url":"https://api.github.com/users/thaume/repos","events_url":"https://api.github.com/users/thaume/events{/privacy}","received_events_url":"https://api.github.com/users/thaume/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/emberjs/data/labels/Feature","name":"Feature","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":54,"created_at":"2014-12-12T20:05:19Z","updated_at":"2015-12-21T19:19:03Z","closed_at":"2015-06-14T09:26:55Z","pull_request":{"url":"https://api.github.com/repos/emberjs/data/pulls/2584","html_url":"https://github.com/emberjs/data/pull/2584","diff_url":"https://github.com/emberjs/data/pull/2584.diff","patch_url":"https://github.com/emberjs/data/pull/2584.patch"},"body":"The findQueryOne method let developers query their server-side API for a single record and also pass a query parameter to this call.\r\n\r\nFor instance, you could do the following:\r\n\r\n```javascript\r\nthis.store.findQueryOne('post', 1, { include: 'comments' });\r\n```"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/166395547","html_url":"https://github.com/emberjs/data/pull/2584#issuecomment-166395547","issue_url":"https://api.github.com/repos/emberjs/data/issues/2584","id":166395547,"user":{"login":"igorT","id":715175,"avatar_url":"https://avatars.githubusercontent.com/u/715175?v=3","gravatar_id":"","url":"https://api.github.com/users/igorT","html_url":"https://github.com/igorT","followers_url":"https://api.github.com/users/igorT/followers","following_url":"https://api.github.com/users/igorT/following{/other_user}","gists_url":"https://api.github.com/users/igorT/gists{/gist_id}","starred_url":"https://api.github.com/users/igorT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorT/subscriptions","organizations_url":"https://api.github.com/users/igorT/orgs","repos_url":"https://api.github.com/users/igorT/repos","events_url":"https://api.github.com/users/igorT/events{/privacy}","received_events_url":"https://api.github.com/users/igorT/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T19:19:03Z","updated_at":"2015-12-21T19:19:03Z","body":"The conversation which helped @hunterboerner for the record\r\n```\r\nwecc [3:03 AM] \r\n@hunterboerner: `queryOne` became `queryRecord`, kind of. The idea is that you shouldn't need an ID to fetch a single record, like if you only have a slug: `store.queryRecord('post', { slug: 'my-post' })`(edited)\r\n\r\n​[3:03] \r\nby default this would give you `/posts?slug=my-post` iirc\r\n\r\n​[3:04] \r\n`store.findRecord('post', 123)` on the other hand accepts an ID and would give you the URL `/posts/123` by default\r\n\r\n​[3:05] \r\nso... what it kind of boils down to is \"How do I pass query params to `findRecord`\" and/or \"How do I pass the ID to `queryRecord`\"(edited)\r\n\r\n​[3:07] \r\n> How do I pass query params to `findRecord`?\r\nYou can use the `adapterOptions` to pass additional information to your adapter, and pass a query hash in there. Here's a very simple implementation of this: https://github.com/emberjs/data/issues/3596#issuecomment-126604014(edited)\r\n\r\nwecc [3:12 AM] \r\n> How do I pass the ID to `queryRecord`?\r\nSince `queryRecord` only accepts `modelName` and `query` you would have to add `id` to the `query` hash and then customize the `urlForQueryRecord` hook to add the ID to the URL (and possibly remove the ID from the query in the `queryRecord` hook)\r\n```"}}