From 5136b333c92119d91741ae7e7c8204775d49940a Mon Sep 17 00:00:00 2001 From: Yannick Scherer Date: Tue, 25 Apr 2017 18:53:00 +0200 Subject: [PATCH] use 'transform-finite' projection for nullable constraint and map ordering. 'transform-finite' has better performance for deeply nested structures since it avoids rewrapping of the transformation result. --- src/alumbra/claro/projection.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alumbra/claro/projection.clj b/src/alumbra/claro/projection.clj index f82d121..1ff6cf8 100644 --- a/src/alumbra/claro/projection.clj +++ b/src/alumbra/claro/projection.clj @@ -77,7 +77,7 @@ (defn- non-nullable-value [{:keys [field-name type-name]} projection] - (projection/transform + (projection/transform-finite (fn [value] (if (nil? value) (data/error @@ -140,7 +140,7 @@ selection-set))] (->> templates (projection/juxt*) - (projection/transform as-ordered-map)) + (projection/transform-finite as-ordered-map)) {})) ;; ## Conditional Blocks