diff --git a/app/assets/javascripts/pages/projects/issues/form.js b/app/assets/javascripts/pages/projects/issues/form.js index 941c45525799a89d77b8dfa25ba556b73a81acb8..2205a7bafe3006a95e2f5bea3b9b7d06d0300258 100644 --- a/app/assets/javascripts/pages/projects/issues/form.js +++ b/app/assets/javascripts/pages/projects/issues/form.js @@ -17,7 +17,5 @@ export default () => { new MilestoneSelect(); new IssuableTemplateSelectors(); - if (gon.features.graphql) { - initSuggestions(); - } + initSuggestions(); }; diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 1ce0afac83bae32f8e42faf30f2885414e05e208..9fbbe373b0da1cb459af42b4be3d4608ff87d158 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -11,7 +11,6 @@ class GraphqlController < ApplicationController # around in GraphiQL. protect_from_forgery with: :null_session, only: :execute - before_action :check_graphql_feature_flag! before_action :authorize_access_api! before_action(only: [:execute]) { authenticate_sessionless_user!(:api) } @@ -86,8 +85,4 @@ class GraphqlController < ApplicationController render json: error, status: status end - - def check_graphql_feature_flag! - render_404 unless Gitlab::Graphql.enabled? - end end diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index b866f574f6732f36ce7a4de8b9df261a543585a0..228de8bc6f3a344d2787014c807d5ed4bb376324 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -45,8 +45,6 @@ class Projects::IssuesController < Projects::ApplicationController before_action :authorize_import_issues!, only: [:import_csv] before_action :authorize_download_code!, only: [:related_branches] - before_action :set_suggested_issues_feature_flags, only: [:new] - respond_to :html def index @@ -285,8 +283,4 @@ class Projects::IssuesController < Projects::ApplicationController # 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426 Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42422') end - - def set_suggested_issues_feature_flags - push_frontend_feature_flag(:graphql, default_enabled: true) - end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 8dee842a22dac22074d092dac180752bdc2f50f8..8d0079a4dd3afedbbb751a8a03f22e08dff5aadc 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -662,6 +662,6 @@ module ProjectsHelper end def vue_file_list_enabled? - Gitlab::Graphql.enabled? && Feature.enabled?(:vue_file_list, @project) + Feature.enabled?(:vue_file_list, @project) end end diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 1bd56e064d5b4212012e16fdd3dfaa5d62ec4533..214e87052da66d5c248328621b04c27d9eaa3118 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -17,8 +17,7 @@ = render 'shared/issuable/form/template_selector', issuable: issuable = render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?) -- if Gitlab::Graphql.enabled? - #js-suggestions{ data: { project_path: @project.full_path } } +#js-suggestions{ data: { project_path: @project.full_path } } = render 'shared/form_elements/description', model: issuable, form: form, project: project diff --git a/config/routes/api.rb b/config/routes/api.rb index 3ba9176d94324bc0967d4a7b530fa9fa2322bc45..c6c17b5708edd00caac435d25b1367e39f940a9f 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -1,7 +1,5 @@ -constraints(::Constraints::FeatureConstrainer.new(:graphql, default_enabled: true)) do - post '/api/graphql', to: 'graphql#execute' - mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: '/api/graphql' -end +post '/api/graphql', to: 'graphql#execute' +mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: '/api/graphql' ::API::API.logger Rails.logger mount ::API::API => '/' diff --git a/doc/api/graphql/index.md b/doc/api/graphql/index.md index 3bf96e279b75c6236cb8ef11e3b8f2f1909700c0..db073321808e42e331778f39fd36c6915ba477ea 100644 --- a/doc/api/graphql/index.md +++ b/doc/api/graphql/index.md @@ -1,4 +1,4 @@ -# GraphQL API (Alpha) +# GraphQL API > [Introduced][ce-19008] in GitLab 11.0. @@ -23,23 +23,13 @@ programmatically with GitLab. To achieve this, it needs full coverage - anything possible in the REST API should also be possible in the GraphQL API. To help us meet this vision, the frontend should use GraphQL in preference to -the REST API for new features, although the alpha status of GraphQL may prevent -this from being a possibility at times. +the REST API for new features. There are no plans to deprecate the REST API. To reduce the technical burden of supporting two APIs in parallel, they should share implementations as much as possible. -## Enabling the GraphQL feature - -The GraphQL API itself is currently in Alpha, and therefore hidden behind a -feature flag. You can enable the feature using the [features api][features-api] on a self-hosted instance. - -For example: - -```shell -curl --data "value=100" --header "PRIVATE-TOKEN: " https://gitlab.example.com/api/v4/features/graphql -``` +As of the 12.1 release, GraphQL is always enabled. ## Available queries diff --git a/lib/api/helpers/graphql_helpers.rb b/lib/api/helpers/graphql_helpers.rb index 94010ab1bc2ffe9d43d704b898ab75b995876c14..bd60470fbd67651db8be40b157dda3c4c5bf7ddd 100644 --- a/lib/api/helpers/graphql_helpers.rb +++ b/lib/api/helpers/graphql_helpers.rb @@ -7,8 +7,6 @@ module API # should be in app/graphql/ or lib/gitlab/graphql/ module GraphqlHelpers def conditionally_graphql!(fallback:, query:, context: {}, transform: nil) - return fallback.call unless Feature.enabled?(:graphql) - result = GitlabSchema.execute(query, context: context) if transform diff --git a/lib/gitlab/graphql.rb b/lib/gitlab/graphql.rb index 8a59e83974f7702e159efbab6097c1e9e6fba06a..74c04e5380e39b4e89f4a2d6ce7108b11d462160 100644 --- a/lib/gitlab/graphql.rb +++ b/lib/gitlab/graphql.rb @@ -3,9 +3,5 @@ module Gitlab module Graphql StandardGraphqlError = Class.new(StandardError) - - def self.enabled? - Feature.enabled?(:graphql, default_enabled: true) - end end end diff --git a/spec/requests/api/graphql_spec.rb b/spec/requests/api/graphql_spec.rb index 67371cb35b604c487d95baa3637496b735e0cf99..54401ec40858685374cfa526de37edc32b62d610 100644 --- a/spec/requests/api/graphql_spec.rb +++ b/spec/requests/api/graphql_spec.rb @@ -6,16 +6,6 @@ describe 'GraphQL' do let(:query) { graphql_query_for('echo', 'text' => 'Hello world' ) } - context 'graphql is disabled by feature flag' do - before do - stub_feature_flags(graphql: false) - end - - it 'does not generate a route for GraphQL' do - expect { post_graphql(query) }.to raise_error(ActionController::RoutingError) - end - end - context 'logging' do shared_examples 'logging a graphql query' do let(:expected_params) do diff --git a/spec/routing/api_routing_spec.rb b/spec/routing/api_routing_spec.rb deleted file mode 100644 index 3c48ead4ff2d015d7caed93b8e88b28300338d17..0000000000000000000000000000000000000000 --- a/spec/routing/api_routing_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -describe 'api', 'routing' do - context 'when graphql is disabled' do - before do - stub_feature_flags(graphql: false) - end - - it 'does not route to the GraphqlController' do - expect(post('/api/graphql')).not_to route_to('graphql#execute') - end - end - - context 'when graphql is enabled' do - before do - stub_feature_flags(graphql: true) - end - - it 'routes to the GraphqlController' do - expect(post('/api/graphql')).to route_to('graphql#execute') - end - end -end