Commit 3ec06263 authored by Brett Walker's avatar Brett Walker

Minor change to fix errors in upcoming gem upgrade

For the upgrade to the graphql gem 1.13.x, minor compatible
changes can be made to the main code base.
parent 1e5a4697
......@@ -101,10 +101,6 @@ module Types
description: 'Web path to blob on an environment.',
calls_gitaly: true
field :code_owners, [Types::UserType], null: true,
description: 'List of code owners for the blob.',
calls_gitaly: true
field :file_type, GraphQL::Types::String, null: true,
description: 'Expected format of the blob based on the extension.'
......
......@@ -37,7 +37,6 @@ module EE
mount_mutation ::Mutations::Vulnerabilities::RevertToDetected
mount_mutation ::Mutations::Vulnerabilities::CreateExternalIssueLink
mount_mutation ::Mutations::Vulnerabilities::DestroyExternalIssueLink
mount_mutation ::Mutations::Boards::Update
mount_mutation ::Mutations::Boards::UpdateEpicUserPreferences
mount_mutation ::Mutations::Boards::EpicBoards::Create
mount_mutation ::Mutations::Boards::EpicBoards::Destroy
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Types::Repository::BlobType do
specify { expect(described_class.graphql_name).to eq('RepositoryBlob') }
specify { expect(described_class).to have_graphql_field(:code_owners, calls_gitaly?: true) }
end
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Types::GlobalIDType do
context 'where we declare an argument as GlobalIDType[a] where a is prepended in EE' do
def query(doc, vars)
GraphQL::Query.new(GitlabSchema.graphql_definition, document: doc, context: {}, variables: vars)
GraphQL::Query.new(GitlabSchema, document: doc, context: {}, variables: vars)
end
def run_query(gql_query, vars)
......
......@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['ProjectSecurityTraining'] do
describe '#is_primary' do
let(:training) { create(:security_training, :primary) }
let(:query) { double('query', schema: GitlabSchema, with_error_handling: true) }
let(:query) { GraphQL::Query.new(GitlabSchema) }
let(:query_context) { GraphQL::Query::Context.new(query: query, values: {}, object: nil) }
let(:type_instance) { described_class.authorized_new(training, query_context) }
......
......@@ -2,7 +2,7 @@
module Gitlab
module Graphql
module Project
class DastProfileConnectionExtension < GraphQL::Schema::Field::ConnectionExtension
class DastProfileConnectionExtension < GraphQL::Schema::FieldExtension
def after_resolve(value:, object:, context:, **rest)
preload_authorizations(context[:project_dast_profiles])
context[:project_dast_profiles] = nil
......
......@@ -24,7 +24,7 @@ RSpec.describe ::Types::RangeInputType do
it 'follows expected subtyping relationships for instances' do
context = GraphQL::Query::Context.new(
query: double('query', schema: nil),
query: GraphQL::Query.new(GitlabSchema),
values: {},
object: nil
)
......
......@@ -34,7 +34,6 @@ RSpec.describe Types::Repository::BlobType do
:environment_external_url_for_route_map,
:code_navigation_path,
:project_blob_path_root,
:code_owners,
:simple_viewer,
:rich_viewer,
:plain_data,
......@@ -47,6 +46,6 @@ RSpec.describe Types::Repository::BlobType do
:ide_fork_and_edit_path,
:fork_and_view_path,
:language
)
).at_least
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment