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