graphql-client
graphql-client copied to clipboard
Misleading error message for invalid configurations
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.