Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.1.18",
"version": "1.1.17",
"main": "index.ts",
"license": "UNLICENSED",
"scripts": {
Expand Down
5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import PlansFactory from './models/plansFactory';
import BusinessOperationsFactory from './models/businessOperationsFactory';
import schema from './schema';
import { graphqlUploadExpress } from 'graphql-upload';
import ReleasesFactory from './models/releaseFactory';

/**
* Option to enable playground
Expand Down Expand Up @@ -146,16 +145,12 @@ class HawkAPI {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const businessOperationsFactory = new BusinessOperationsFactory(mongo.databases.hawk!, dataLoaders);

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const releasesFactory = new ReleasesFactory(mongo.databases.events!, dataLoaders);

return {
usersFactory,
workspacesFactory,
projectsFactory,
plansFactory,
businessOperationsFactory,
releasesFactory,
};
}

Expand Down
92 changes: 0 additions & 92 deletions src/models/releaseFactory.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/resolvers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,26 +265,6 @@ module.exports = {
return event;
},

/**
* Returns project releases
*
* @param {ProjectDBScheme} project - result of parent resolver
* @param {ContextFactories} context - Global GraphQL context with factories
* @returns {Promise<Release[]>}
*/
async releases(project, _, { factories }) {
if (!project._id) {
throw new Error('projectId is required to fetch releases');
}

try {
return await factories.releasesFactory.findManyByProjectId(project._id.toString());
} catch (error) {
console.error('Error fetching releases:', error);
throw new Error('Failed to get the releases');
}
},

/**
* Find project events
*
Expand Down
40 changes: 40 additions & 0 deletions src/typeDefs/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,46 @@ type SourceCodeLine {
content: String
}

"""
Release commit
"""
type Commit {
"""
Hash of the commit
"""
hash: String!

"""
Commit author
"""
author: String!

"""
Commit title
"""
title: String!

"""
Commit creation date
"""
date: DateTime!
}

"""
Release data of the corresponding event
"""
type Release {
"""
Release name
"""
releaseName: String! @renameFrom(name: "release")

"""
Release commits
"""
commits: [Commit!]!
}

"""
Event backtrace representation
"""
Expand Down
2 changes: 0 additions & 2 deletions src/typeDefs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import workspaceMutations from './workspaceMutations';
import chart from './chart';
import plans from './plans';
import seed from './seed';
import release from './release';
import isE2E from '../utils/isE2E';

const rootSchema = gql`
Expand Down Expand Up @@ -101,7 +100,6 @@ const typeDefinitions = [
workspaceMutations,
chart,
plans,
release,
projectEventGroupingPattern,
projectEventGroupingPatternMutations,
];
Expand Down
5 changes: 0 additions & 5 deletions src/typeDefs/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ type Project {
skip: Int = 0
): [Event!]

"""
Project releases
"""
releases: [Release!]!

"""
Returns recent events grouped by day
"""
Expand Down
78 changes: 0 additions & 78 deletions src/typeDefs/release.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/types/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import UsersFactory from '../models/usersFactory';
import WorkspacesFactory from '../models/workspacesFactory';
import { GraphQLField } from 'graphql';
import ProjectsFactory from '../models/projectsFactory';
// import Accounting from 'codex-accounting-sdk';
import PlansFactory from '../models/plansFactory';
import BusinessOperationsFactory from '../models/businessOperationsFactory';
import ReleasesFactory from '../models/releaseFactory';

/**
* Resolver's Context argument
Expand Down Expand Up @@ -79,11 +79,6 @@ export interface ContextFactories {
* Allows to work with the Business Operations models
*/
businessOperationsFactory: BusinessOperationsFactory;

/**
* Allows to work with releases
*/
releasesFactory: ReleasesFactory;
}

/**
Expand Down
Loading