Use double quotes in controllers/

This commit is contained in:
Julian Herrero
2019-03-13 22:19:49 +01:00
parent 3c313c9c52
commit d24376f6ad
78 changed files with 236 additions and 236 deletions

View File

@@ -12,11 +12,11 @@ class GraphqlController < ApplicationController
response = consul_schema.execute query_string, variables: query_variables
render json: response, status: :ok
rescue GraphqlController::QueryStringError
render json: { message: 'Query string not present' }, status: :bad_request
render json: { message: "Query string not present" }, status: :bad_request
rescue JSON::ParserError
render json: { message: 'Error parsing JSON' }, status: :bad_request
render json: { message: "Error parsing JSON" }, status: :bad_request
rescue GraphQL::ParseError
render json: { message: 'Query string is not valid JSON' }, status: :bad_request
render json: { message: "Query string is not valid JSON" }, status: :bad_request
rescue
unless Rails.env.production? then raise end
end
@@ -36,7 +36,7 @@ class GraphqlController < ApplicationController
end
def query_string
if request.headers["CONTENT_TYPE"] == 'application/graphql'
if request.headers["CONTENT_TYPE"] == "application/graphql"
request.body.string # request.body.class => StringIO
else
params[:query]
@@ -44,7 +44,7 @@ class GraphqlController < ApplicationController
end
def query_variables
if params[:variables].blank? || params[:variables] == 'null'
if params[:variables].blank? || params[:variables] == "null"
{}
else
JSON.parse(params[:variables])