Skip to content

Commit

Permalink
context is now a private method in GrahqlController
Browse files Browse the repository at this point in the history
It will be easier to override
  • Loading branch information
bricesanchez committed Nov 30, 2017
1 parent c42b71c commit 7b3d86e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions api/app/controllers/refinery/admin/graphql_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ def execute
query = params[:query]
variables = params[:variables] || {}

context = {
current_user: current_refinery_user
}

begin
result = Refinery::Api::GraphqlSchema.execute(query, variables: variables, context: context)
rescue => error
Expand All @@ -18,6 +14,14 @@ def execute

render json: result
end

private

def context
{
current_user: current_refinery_user
}
end
end
end
end

0 comments on commit 7b3d86e

Please sign in to comment.