Skip to content

Instantly share code, notes, and snippets.

@eyston

eyston/getter.clj

Created Mar 9, 2015
Embed
What would you like to do?
(def graph {:roots {} :nodes {}})
;; end up wit ha structure like this after adding a node
(def graph {:roots {} :nodes {'Organization {:fields {:id {}}}}})
;; do I do this?
(let [field (get-in graph [:nodes 'Organization :fields :id])]
;; ...
)
;; or ...
(defn get-field [graph node name]
(get-in graph [:nodes node :fields name]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment