File tree Expand file tree Collapse file tree 7 files changed +56
-86
lines changed
Expand file tree Collapse file tree 7 files changed +56
-86
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ const userNotifications = require('./userNotifications').default;
1717const billing = require ( './billingNew' ) . default ;
1818const EncodedJSON = require ( './encodedJSON' ) . default ;
1919const seed = require ( './seed' ) . default ;
20- const release = require ( './release' ) . default ;
2120
2221/**
2322 * @typedef ResolverObj
@@ -75,7 +74,6 @@ const resolvers = [
7574 userNotifications ,
7675 plans ,
7776 billing ,
78- release ,
7977] ;
8078
8179if ( isE2E ) {
Original file line number Diff line number Diff line change @@ -265,6 +265,26 @@ module.exports = {
265265 return event ;
266266 } ,
267267
268+ /**
269+ * Returns project releases
270+ *
271+ * @param {ProjectDBScheme } project - result of parent resolver
272+ * @param {ContextFactories } context - Global GraphQL context with factories
273+ * @returns {Promise<Release[]> }
274+ */
275+ async releases ( project , _ , { factories } ) {
276+ if ( ! project . _id ) {
277+ throw new Error ( 'projectId is required to fetch releases' ) ;
278+ }
279+
280+ try {
281+ return await factories . releasesFactory . findManyByProjectId ( project . _id . toString ( ) ) ;
282+ } catch ( error ) {
283+ console . error ( 'Error fetching releases:' , error ) ;
284+ throw new Error ( 'Failed to get the releases' ) ;
285+ }
286+ } ,
287+
268288 /**
269289 * Find project events
270290 *
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ type SourceCodeLine {
1616 content: String
1717}
1818
19+ """
20+ Source map file details
21+ """
22+ type SourceMapData {
23+ """
24+ Source map filename
25+ """
26+ mapFileName: String!
27+
28+ """
29+ Original source filename
30+ """
31+ originFileName: String!
32+ }
33+
1934"""
2035Release commit
2136"""
@@ -42,18 +57,33 @@ type Commit {
4257}
4358
4459"""
45- Release data of the corresponding event
60+ Release data
4661"""
4762type Release {
63+ """
64+ Release ID
65+ """
66+ id: ID! @renameFrom(name: "_id")
67+
4868 """
4969 Release name
5070 """
5171 releaseName: String! @renameFrom(name: "release")
5272
73+ """
74+ Project ID associated with the release
75+ """
76+ projectId: ID!
77+
5378 """
5479 Release commits
5580 """
5681 commits: [Commit!]!
82+
83+ """
84+ Source maps associated with the release
85+ """
86+ files: [SourceMapData!]!
5787}
5888
5989"""
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import workspaceMutations from './workspaceMutations';
1515import chart from './chart' ;
1616import plans from './plans' ;
1717import seed from './seed' ;
18- import release from './release' ;
1918import isE2E from '../utils/isE2E' ;
2019
2120const rootSchema = gql `
@@ -99,7 +98,6 @@ const typeDefinitions = [
9998 workspaceMutations ,
10099 chart ,
101100 plans ,
102- release ,
103101] ;
104102
105103if ( isE2E ) {
Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ type Project {
109109 skip: Int = 0
110110 ): [Event!]
111111
112+ """
113+ Project releases
114+ """
115+ releases: [Release!]!
116+
112117 """
113118 Returns recent events grouped by day
114119 """
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments