Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #17

Closed
wants to merge 4 commits into from
Closed

test #17

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/com/walmartlabs/lacinia.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
:or {timeout-ms 0
timeout-error {:message "Query execution timed out."}}} options
context' (cond-> context
(:analyze-query options) query-analyzer/enable-query-analyzer)
(:analyze-query options) query-analyzer/enable-query-analyzer)
execution-result (execute-parsed-query-async parsed-query variables context')
result (do
(resolve/on-deliver! execution-result *result)
Expand Down
8 changes: 4 additions & 4 deletions src/com/walmartlabs/lacinia/executor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,7 @@
(let [enabled-selections (remove :disabled? selections)
*errors (atom [])
*warnings (atom [])
*extensions (if (::query-analyzer/enable? context)
(atom {:analysis (query-analyzer/complexity-analysis parsed-query)})
(atom {}))
*extensions (atom {})
*resolver-tracing (when (::tracing/enabled? context)
(atom []))
context' (assoc context constants/schema-key schema)
Expand All @@ -414,6 +412,7 @@
(let [errors (seq @*errors)
warnings (seq @*warnings)
extensions @*extensions]
(prn errors)
(resolve/deliver! result-promise
(cond-> {:data (schema/collapse-nulls-in-map selected-data)}
(seq extensions) (assoc :extensions extensions)
Expand All @@ -422,7 +421,8 @@
(::tracing/parsing parsed-query)
(::tracing/validation context)
@*resolver-tracing)
errors (assoc :errors (distinct errors))
errors (assoc :errors (distinct errors))
(and (nil? errors) (::query-analyzer/enable? context)) (assoc-in [:extensions :analysis] (query-analyzer/complexity-analysis parsed-query))
warnings (assoc-in [:extensions :warnings] (distinct warnings))))))))
(catch Throwable t
(resolve/deliver! result-promise t))))]
Expand Down
Loading