Commit f16b1311 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Fix incorrect instances of `GraphQL::ID_TYPE`

Since the `GraphQL::ID_TYPE` usages should represent globally unique
ids, this changes some fields for which this is not the case into
strings.

The `ID_TYPE` is a specialised, so this change should be backwards
compatible.

https://graphql-ruby.org/type_definitions/scalars.html
parent ed503d51
...@@ -10,7 +10,7 @@ module Mutations ...@@ -10,7 +10,7 @@ module Mutations
required: true, required: true,
description: "The project the merge request to mutate is in" description: "The project the merge request to mutate is in"
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
description: "The iid of the merge request to mutate" description: "The iid of the merge request to mutate"
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module Resolvers module Resolvers
class IssuesResolver < BaseResolver class IssuesResolver < BaseResolver
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'The IID of the issue, e.g., "1"' description: 'The IID of the issue, e.g., "1"'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::STRING_TYPE],
required: false, required: false,
description: 'The list of IIDs of issues, e.g., [1, 2]' description: 'The list of IIDs of issues, e.g., [1, 2]'
argument :state, Types::IssuableStateEnum, argument :state, Types::IssuableStateEnum,
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module Resolvers module Resolvers
class MergeRequestsResolver < BaseResolver class MergeRequestsResolver < BaseResolver
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'The IID of the merge request, e.g., "1"' description: 'The IID of the merge request, e.g., "1"'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::STRING_TYPE],
required: false, required: false,
description: 'The list of IIDs of issues, e.g., [1, 2]' description: 'The list of IIDs of issues, e.g., [1, 2]'
......
...@@ -10,7 +10,7 @@ module Types ...@@ -10,7 +10,7 @@ module Types
expose_permissions Types::PermissionTypes::Ci::Pipeline expose_permissions Types::PermissionTypes::Ci::Pipeline
field :id, GraphQL::ID_TYPE, null: false field :id, GraphQL::ID_TYPE, null: false
field :iid, GraphQL::ID_TYPE, null: false field :iid, GraphQL::STRING_TYPE, null: false
field :sha, GraphQL::STRING_TYPE, null: false field :sha, GraphQL::STRING_TYPE, null: false
field :before_sha, GraphQL::STRING_TYPE, null: true field :before_sha, GraphQL::STRING_TYPE, null: true
......
...@@ -11,7 +11,7 @@ module Types ...@@ -11,7 +11,7 @@ module Types
present_using MergeRequestPresenter present_using MergeRequestPresenter
field :id, GraphQL::ID_TYPE, null: false field :id, GraphQL::ID_TYPE, null: false
field :iid, GraphQL::ID_TYPE, null: false field :iid, GraphQL::STRING_TYPE, null: false
field :title, GraphQL::STRING_TYPE, null: false field :title, GraphQL::STRING_TYPE, null: false
field :description, GraphQL::STRING_TYPE, null: true field :description, GraphQL::STRING_TYPE, null: true
field :state, MergeRequestStateEnum, null: false field :state, MergeRequestStateEnum, null: false
......
...@@ -11,7 +11,7 @@ describe 'Setting WIP status of a merge request' do ...@@ -11,7 +11,7 @@ describe 'Setting WIP status of a merge request' do
let(:mutation) do let(:mutation) do
variables = { variables = {
project_path: project.full_path, project_path: project.full_path,
iid: merge_request.iid iid: merge_request.iid.to_s
} }
graphql_mutation(:merge_request_set_wip, variables.merge(input)) graphql_mutation(:merge_request_set_wip, variables.merge(input))
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