graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Misleading error message for invalid configurations

Open rlgreen91 opened this issue 6 years ago • 0 comments

So, I made an error with my configuration of the gem and ended up with this:

HTTP = GraphQL::Client::HTTP.new("#{ENV.fetch('EXELON_HOST')}/graphql") do
    def headers(context)
    end
end

But, when running a spec that uses the client, I actually got this as the error:

Sites API GET /index should return a list of sites
     Failure/Error: let(:request) { get '/v2/sites', params: {}, headers: {} }

     AbstractController::ActionNotFound:
       The action 'index' could not be found for V2::SitesController

The error message could be better for this. Maybe an early check of the configuration? Although I'm not sure how to do that without including it in the application config settings.

rlgreen91 avatar Aug 10 '18 21:08 rlgreen91