File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ 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 ;
2021
2122/**
2223 * @typedef ResolverObj
@@ -74,6 +75,7 @@ const resolvers = [
7475 userNotifications ,
7576 plans ,
7677 billing ,
78+ release ,
7779] ;
7880
7981if ( isE2E ) {
Original file line number Diff line number Diff line change 1+ import ReleasesFactory from '../models/releaseFactory' ;
2+
3+ export default {
4+ Query : {
5+ /**
6+ * Fetch all releases or releases filtered by projectId
7+ * @param {ResolverObj } _ - Parent object, not used
8+ * @param {ResolverArgs } args - Query arguments
9+ * @param {ContextFactories } context - Global GraphQL context with factories
10+ * @returns {Promise<Release[]> }
11+ */
12+ getReleases : async ( _ : any , args : { projectId ?: string } , { factories } : any ) => {
13+ try {
14+ if ( args . projectId ) {
15+ return await factories . releasesFactory . getReleasesByProjectId ( args . projectId ) ;
16+ }
17+ return await factories . releasesFactory . getAllReleases ( ) ;
18+ } catch ( error ) {
19+ console . error ( 'Error fetching releases:' , error ) ;
20+ throw new Error ( 'Не удалось получить релизы' ) ;
21+ }
22+ } ,
23+ } ,
24+ } ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import workspaceMutations from './workspaceMutations';
1515import chart from './chart' ;
1616import plans from './plans' ;
1717import seed from './seed' ;
18+ import release from './release' ;
1819import isE2E from '../utils/isE2E' ;
1920
2021const rootSchema = gql `
@@ -98,6 +99,7 @@ const typeDefinitions = [
9899 workspaceMutations ,
99100 chart ,
100101 plans ,
102+ release ,
101103] ;
102104
103105if ( isE2E ) {
You can’t perform that action at this time.
0 commit comments