app/controllers/graphql_controller.rb
# If accessing from outside this domain, nullify the session
# This allows for outside API access while preventing CSRF attacks,
# but you'll have to authenticate your user separately
# protect_from_forgery with: :null_session
If accessing from outside this domain, nullify the session
This allows for outside API access while preventing CSRF attacks,
but you'll have to authenticate your user separately
protect_from_forgery with: :null_session
If accessing from outside this domain nullify the session This allows for outside API access while preventing CSRF attacks but you ' ll have to authenticate your user separately protect_from_forgery with : : null_session
def execute
    variables = prepare_variables(params[:variables])
    query = params[:query]
    operation_name = params[:operationName]
    context = {
      current_user: current_user
    }
    result = MyfifaApiSchema.execute query,
                                     variables: variables,
                                     context: context,
                                     operation_name: operation_name
    render json: result
  end
def execute variables = prepare_variables ( params [ :variables ] ) query = params [ :query ] operation_name = params [ :operationName ] context = { current_user : current_user } result = MyfifaApiSchema . execute query , variables : variables , context : context , operation_name : operation_name render json : result end
If accessing from outside this domain, nullify the session
This allows for outside API access while preventing CSRF attacks,
but you'll have to authenticate your user separately
protect_from_forgery with: :null_session
If accessing from outside this domain nullify the session This allows for outside API access while preventing CSRF attacks but you ' ll have to authenticate your user separately protect_from_forgery with : : null_session
# Query context goes here, for example: