binaryseed / new_relic_absinthe

Absinthe Instrumentation for the New Relic Elixir Agent
https://hex.pm/packages/new_relic_absinthe
Apache License 2.0
19 stars 13 forks source link

Fix to handle other middleware #6

Closed mmrobins closed 4 years ago

mmrobins commented 5 years ago

Currently the pattern matching on call function can't handle if any middleware is ahead of the {Absinthe.Resolution, :call} middleware.

binaryseed commented 5 years ago

I'm not quite clear what the problem you are trying to fix is.. Your description says it can't handle if another middleware is ahead of the instrumentation, but the change to the test schema is adding a middleware after the instrumentation...

mmrobins commented 5 years ago

Not ahead of instrumentation, can't handle if any middleware is ahead of the {Absinthe.Resolution, :call}.

The current implementation on master assumes that Absinthe.Resolution is the first thing on the middleware list %{middleware: [{{Absinthe.Resolution, :call}, resolver_fn} | _]} = res, and it often won't be. Auth middleware for example.

uesteibar commented 4 years ago

I'm having this same issue too, could we resolve the conflicts and get it merged? 🙏 I'm here to help if that's needed

mmrobins commented 4 years ago

I fixed the merge conflict, was just a whitespace change. I'm no longer working in a elixir codebase, so I've not checked this as working like I originally did months ago.

uesteibar commented 4 years ago

@mmrobins I've tested this and works as expected, thanks! 🎉