Skip to content

Commit 7684ba7

Browse files
committed
Fix tests
1 parent 8be8a27 commit 7684ba7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/generators/graphql/templates/graphql_controller.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class GraphqlController < ApplicationController
33
# This allows for outside API access while preventing CSRF attacks,
44
# but you'll have to authenticate your user separately
55
protect_from_forgery with: :null_session
6-
6+
77
def execute
88
variables = ensure_hash(params[:variables])
99
query = params[:query]

spec/integration/rails/generators/graphql/install_generator_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ def test_field
176176

177177
EXPECTED_GRAPHQLS_CONTROLLER = <<-'RUBY'
178178
class GraphqlController < ApplicationController
179+
# If accessing from outside this domain, nullify the session
180+
# This allows for outside API access while preventing CSRF attacks,
181+
# but you'll have to authenticate your user separately
182+
protect_from_forgery with: :null_session
183+
179184
def execute
180185
variables = ensure_hash(params[:variables])
181186
query = params[:query]

0 commit comments

Comments
 (0)