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

Add functionality to easily integrate with DocumentResolvers #15

Open
lytedev opened this issue Jun 19, 2019 · 3 comments
Open

Add functionality to easily integrate with DocumentResolvers #15

lytedev opened this issue Jun 19, 2019 · 3 comments

Comments

@lytedev
Copy link

lytedev commented Jun 19, 2019

The existing push/pop phases will fail completely if you attempt to integrate them into a DocumentResolver pipeline. It'd be great if a simple way was provided to add similar tracing phases for such situations.

I hope to submit a PR shortly, but my absinthe knowledge is fairly limited, so feedback and discussion on this issue in the meantime would be invaluable. I also may say a number of things that are completely incorrect, so please bear with me!

For example, the existing tracer push/pop phases happen after the Absinthe.Phase.Blueprint and Absinthe.Phase.Document.Result phases. I assume the latter one will remain the same, but is there an analog to Absinthe.Phase.Blueprint when dealing with a DocumentResolver? If so, it shouldn't be overly difficult to add two new push/pop modules (or at least just push) and add an add_document_resolver_phases/1 function that does something similar.

Once that's done, all that needs to be added is a note in the readme that users' DocumentResolver modules should indeed override the pipeline/1 callback and include this new phase-adding function.

Please share any thoughts you might have! Perhaps this entire issue is misguided and I'm missing something obvious, which would actually be wonderful.

Thanks!

lytedev pushed a commit to postmates/opencensus_absinthe that referenced this issue Jun 19, 2019
@garthk
Copy link
Collaborator

garthk commented Jun 22, 2019

I'm having trouble finding references to DocumentResolver. Could you point me to some resources?

@garthk
Copy link
Collaborator

garthk commented Jun 22, 2019

If you rebase #14 on #17, will that help show the document resolver in action?

@lytedev
Copy link
Author

lytedev commented Jun 24, 2019

I'm having trouble finding references to DocumentResolver. Could you point me to some resources?

That's because I used the wrong word! I'm so sorry!

I believe they are referred to as DocumentProviders. Derp.

https://hexdocs.pm/absinthe_plug/Absinthe.Plug.DocumentProvider.html#content

If you rebase #14 on #17, will that help show the document resolver in action?

Probably not. I can attempt to maybe write some tests, but I'm fairly new to both Absinthe and OpenCensus, so it may take some time.


Let me know if you want me to rename this issue with the correct terminology.

lytedev pushed a commit to postmates/opencensus_absinthe that referenced this issue Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants