Skip to content

Instantly share code, notes, and snippets.

@eyston
Created March 9, 2015 18:18
Show Gist options
  • Save eyston/38574e7430c78cdda36c to your computer and use it in GitHub Desktop.
Save eyston/38574e7430c78cdda36c to your computer and use it in GitHub Desktop.
(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