Commit 7d4cc076 authored by Alex Kalderimis's avatar Alex Kalderimis

Connect designs-at-versions to design-collections

This mounts the new resolvers on the design collection type
parent da30fdb5
......@@ -12,14 +12,32 @@ module Types
description: 'Project associated with the design collection'
field :issue, Types::IssueType, null: false,
description: 'Issue associated with the design collection'
field :designs, Types::DesignManagement::DesignType.connection_type, null: false,
field :designs,
Types::DesignManagement::DesignType.connection_type,
null: false,
resolver: Resolvers::DesignManagement::DesignsResolver,
description: 'All designs for the design collection'
# TODO: allow getting a single design by filename
# exposing all designs
field :versions, Types::DesignManagement::VersionType.connection_type,
field :versions,
Types::DesignManagement::VersionType.connection_type,
resolver: Resolvers::DesignManagement::VersionsResolver,
description: 'All versions related to all designs, ordered newest first'
field :version,
Types::DesignManagement::VersionType,
resolver: Resolvers::DesignManagement::VersionsResolver.single,
description: 'A specific version'
field :design_at_version, ::Types::DesignManagement::DesignAtVersionType,
null: true,
resolver: ::Resolvers::DesignManagement::DesignAtVersionResolver,
description: 'Find a design as of a version'
field :design, ::Types::DesignManagement::DesignType,
null: true,
resolver: ::Resolvers::DesignManagement::DesignResolver,
description: 'Find a specific design'
end
end
end
......@@ -5,5 +5,9 @@ require 'spec_helper'
describe GitlabSchema.types['DesignCollection'] do
it { expect(described_class).to require_graphql_authorizations(:read_design) }
it { expect(described_class).to have_graphql_fields(:project, :issue, :designs, :versions) }
it 'has the expected fields' do
expected_fields = %i[project issue designs versions version designAtVersion design]
expect(described_class).to have_graphql_fields(*expected_fields)
end
end
......@@ -3,11 +3,11 @@
require 'spec_helper'
describe GitlabSchema.types['DesignVersion'] do
let(:expected_fields) do
%i[id sha designs design_at_version designs_at_version]
end
it { expect(described_class).to require_graphql_authorizations(:read_design) }
it { expect(described_class).to have_graphql_fields(*expected_fields) }
it 'has the expected fields' do
expected_fields = %i[id sha designs design_at_version designs_at_version]
expect(described_class).to have_graphql_fields(*expected_fields)
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