absinthe-graphql/absinthe_phoenix

Call Phoenix Controller action from an Absinthe resolver

joshio1 opened this issue · 1 comments

Hi,

I have a doubt about how to go about a problem. I think this repo is the closest I can get to an answer.
Here is my problem statement:

I have an existing Phoenix Project (Pure API project without UI). I have a controller and an action which is called whenever a POST request is received with certain parameters.
There are around 5 to 6 plugs which get called before it comes to the action method in the controller.

Now, I currently use POSTMAN to make POST calls to this API. However, in POSTMAN, there is no validation for the parameters which are passed as a body to this POST request.

This is where GraphQL comes in. I am thinking about using GraphIQL as an alternative to POSTMAN so that I can get introspection and validation.

Now, I have setup Absinthe and got to the point where the resolver method gets called for the GraphIQL request. Now, the question is how do I exercise the Controller Action from this resolver. Note that my GraphIQL request should also go through the 5 6 plugs and then go to the controller action. The controller action will return back the output to the GraphIQL web interface.

Can anyone please point me to something which help me achieve this?

Hi @joshio1, I'd recommend using something like https://elixirforum.com/ for general questions or guidance, the issue tracker is for issues and proposals.