Skip to content

Commit

Permalink
Merge pull request #3855 from alphagov/update-graphql-flag
Browse files Browse the repository at this point in the history
Enable toggling of GraphQL with query string
  • Loading branch information
brucebolt authored Nov 18, 2024
2 parents 7eea2a7 + 2153816 commit 5f3e5d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/world_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class WorldController < ApplicationController
def index
if Features.graphql_feature_enabled?
if Features.graphql_feature_enabled? || params.include?(:graphql)
index = WorldIndexGraphql.find!("/world")
@presented_index = WorldIndexGraphqlPresenter.new(index)
else
Expand Down
12 changes: 12 additions & 0 deletions spec/features/world_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,16 @@

it_behaves_like "world index page"
end

context "with the GraphQL query string" do
before do
stub_publishing_api_graphql_query(
Graphql::WorldIndexQuery.new("/world").query,
fetch_graphql_fixture("world_index"),
)
visit "/world?graphql=true"
end

it_behaves_like "world index page"
end
end

0 comments on commit 5f3e5d4

Please sign in to comment.