{"action":"closed","issue":{"url":"https://api.github.com/repos/omcljs/om/issues/605","repository_url":"https://api.github.com/repos/omcljs/om","labels_url":"https://api.github.com/repos/omcljs/om/issues/605/labels{/name}","comments_url":"https://api.github.com/repos/omcljs/om/issues/605/comments","events_url":"https://api.github.com/repos/omcljs/om/issues/605/events","html_url":"https://github.com/omcljs/om/issues/605","id":132006953,"number":605,"title":"focus->path and paths with identity -- expected behavior?","user":{"login":"eyston","id":187389,"avatar_url":"https://avatars.githubusercontent.com/u/187389?v=3","gravatar_id":"","url":"https://api.github.com/users/eyston","html_url":"https://github.com/eyston","followers_url":"https://api.github.com/users/eyston/followers","following_url":"https://api.github.com/users/eyston/following{/other_user}","gists_url":"https://api.github.com/users/eyston/gists{/gist_id}","starred_url":"https://api.github.com/users/eyston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyston/subscriptions","organizations_url":"https://api.github.com/users/eyston/orgs","repos_url":"https://api.github.com/users/eyston/repos","events_url":"https://api.github.com/users/eyston/events{/privacy}","received_events_url":"https://api.github.com/users/eyston/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-07T20:22:38Z","updated_at":"2016-05-21T20:53:20Z","closed_at":"2016-05-21T20:53:20Z","body":"Hello, I have the following query:\r\n\r\n```cljs\r\n[{[:person/by-id 2] [:id :name]}\r\n {[:person/by-id 5] [:id :name]}]\r\n```\r\n\r\nWhen I focused it by `[[:person/by-id 2]]` I get the following focused query:\r\n\r\n```cljs\r\n[{[:person/by-id 2] [:id :name]}]\r\n```\r\n\r\nIf I call `focus->path` on this query, it gives a focused path of `[:person/by-id]`.  I expected `[[:person/by-id 2]]`.  I'm not sure if my expectation is correct.\r\n\r\nThis is causing a problem in that child components of the query fail on `full-query` as it can't connect the `focus->path` with the components path.\r\n\r\nMy understanding is that joined idents are legal parts of `QueryExpr` so this should work.\r\n\r\nThe code in question is:\r\n\r\nhttps://github.com/omcljs/om/blob/1e51c4812cb9e8dd259a1f6f038a1a725906a74e/src/main/om/next.cljs#L202\r\n\r\n```cljs\r\n(let [[k focus'] (join-entry (first focus))\r\n       k (if (ident? k) (first k) k)\r\n       focus'     (if (recursion? focus')\r\n```\r\n\r\nhttps://github.com/omcljs/om/blob/1e51c4812cb9e8dd259a1f6f038a1a725906a74e/src/main/om/next.cljs#L1119\r\n\r\n```cljs\r\n(let [q (first (filter #(= path' (-> % zip/root (focus->path path'))) qs))]\r\n  (if-not (nil? q)\r\n```\r\n\r\nI guess I expect the behavior similar to `db->tree`:\r\n\r\nhttps://github.com/omcljs/om/blob/1e51c4812cb9e8dd259a1f6f038a1a725906a74e/src/main/om/next.cljs#L1294-L1297\r\n\r\n```cljs\r\n(if (ident? key)\r\n  (if (= '_ (second key))\r\n    (get refs (first key))\r\n    (get-in refs (map-ident key)))\r\n```\r\nThe use case for this is having a route like `/person/{person-id}` where we are doing root queries directly on a user, e.g. `[[person/by-id ?person-id]]`.\r\n\r\nThanks!"}}
{"actor":{"display_login":"swannodette"}}