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

Tracing "validation" fields are always null #448

Open
favila opened this issue Jun 13, 2023 · 0 comments
Open

Tracing "validation" fields are always null #448

favila opened this issue Jun 13, 2023 · 0 comments

Comments

@favila
Copy link

favila commented Jun 13, 2023

When using the "tracing" extension (e.g. the lacinia-timing header in pedestal), the "validation" field always looks like {:startOffset nil, :duration nil} instead of having an offset and duration.

I believe this is because lacinia execute-query pulls the ::timing/validation entry off the context map instead of the parsed-query map.

Both com.walmartlabs.lacinia.pedestal.internal/on-enter-prepare-query and com.walmartlabs.lacina/execute-parsed-query-async seem to add this to the parsed-query map, not its parent map.

As a workaround in lacinia-pedestal, I insert the following interceptor somewhere in-between l.pedestal2/prepare-query-interceptor and l.pedestal2/query-executor-handler to copy the validation data to the place execute-query expects, although I think execute-query is probably the code that should change here.

(interceptor
     {:enter (fn [pctx]
               (update-in pctx [:request :lacinia-app-context] conj
                          (find (-> pctx :request :parsed-lacinia-query)
                                :com.walmartlabs.lacinia.tracing/validation)))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant