Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
1e16miin committed Jul 15, 2024
1 parent 6efca91 commit 4936cb1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/com/walmartlabs/lacinia/complexity_analysis.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
[{:keys [arguments fragment-name selections field-name leaf?]
:as _selection} fragment-map]
(match [(boolean leaf?) fragment-name]
;; for leaf field
[true _] nil
[false nil] (cond-> {:field-name field-name}
selections (assoc :selections (mapcat #(parse-query % fragment-map) selections))
arguments (assoc :arguments arguments)
true vector)
;; for inline fragment
[false nil] (mapcat #(parse-query % fragment-map) selections)
;; for named fragment
[false _] (let [{fragment-selections :selections} (fragment-name fragment-map)]
(mapcat #(parse-query % fragment-map) fragment-selections))))

Expand Down

0 comments on commit 4936cb1

Please sign in to comment.