Skip to content

Commit

Permalink
Add created_at field to incidents and promoted submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvarela committed Dec 19, 2024
1 parent 1e481bd commit 6aaf382
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions site/gatsby-site/server/fields/submissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const mutationFields: GraphQLFieldConfigMap<any, Context> = {
implicated_systems: submission.implicated_systems || [],
editor_notes: submission.editor_notes ?? '',
flagged_dissimilar_incidents: [],
created_at: new Date(),
}
if (submission.embedding) {
newIncident.embedding = {
Expand Down
5 changes: 5 additions & 0 deletions site/gatsby-site/server/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,7 @@ export type Incident = {
AllegedDeveloperOfAISystem?: Maybe<Array<Maybe<Entity>>>;
AllegedHarmedOrNearlyHarmedParties?: Maybe<Array<Maybe<Entity>>>;
_id?: Maybe<Scalars['ObjectId']['output']>;
created_at?: Maybe<Scalars['DateTime']['output']>;
date: Scalars['String']['output'];
description?: Maybe<Scalars['String']['output']>;
editor_dissimilar_incidents?: Maybe<Array<Maybe<Scalars['Int']['output']>>>;
Expand Down Expand Up @@ -1624,6 +1625,7 @@ export type IncidentFilterType = {
NOR?: InputMaybe<Array<InputMaybe<IncidentFilterType>>>;
OR?: InputMaybe<Array<InputMaybe<IncidentFilterType>>>;
_id?: InputMaybe<ObjectIdFilter>;
created_at?: InputMaybe<DateTimeFilter>;
date?: InputMaybe<StringFilter>;
description?: InputMaybe<StringFilter>;
editor_dissimilar_incidents?: InputMaybe<IntFilter>;
Expand Down Expand Up @@ -1654,6 +1656,7 @@ export type IncidentInsertType = {
AllegedDeveloperOfAISystem?: InputMaybe<IncidentAllegeddeveloperofaisystemRelationInput>;
AllegedHarmedOrNearlyHarmedParties?: InputMaybe<IncidentAllegedharmedornearlyharmedpartiesRelationInput>;
_id?: InputMaybe<Scalars['ObjectId']['input']>;
created_at?: InputMaybe<Scalars['DateTime']['input']>;
date: Scalars['String']['input'];
description?: InputMaybe<Scalars['String']['input']>;
editor_dissimilar_incidents?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>;
Expand Down Expand Up @@ -1835,6 +1838,7 @@ export type IncidentSetType = {
AllegedDeveloperOfAISystem?: InputMaybe<IncidentAllegeddeveloperofaisystemRelationInput>;
AllegedHarmedOrNearlyHarmedParties?: InputMaybe<IncidentAllegedharmedornearlyharmedpartiesRelationInput>;
_id?: InputMaybe<Scalars['ObjectId']['input']>;
created_at?: InputMaybe<Scalars['DateTime']['input']>;
date?: InputMaybe<Scalars['String']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
editor_dissimilar_incidents?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>;
Expand Down Expand Up @@ -1871,6 +1875,7 @@ export enum IncidentSortByInput {

export type IncidentSortType = {
_id?: InputMaybe<SortType>;
created_at?: InputMaybe<SortType>;
date?: InputMaybe<SortType>;
description?: InputMaybe<SortType>;
editor_notes?: InputMaybe<SortType>;
Expand Down
2 changes: 2 additions & 0 deletions site/gatsby-site/server/types/incidents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getListRelationshipConfig, getListRelationshipExtension, getListRelatio
import { UserType } from "./user";
import { IncidentEmbeddingType, NlpSimilarIncidentType, TsneType } from "./types";
import { ReportType } from "./report";
import { GraphQLDateTime } from "graphql-scalars";

export const IncidentType = new GraphQLObjectType({
name: 'Incident',
Expand Down Expand Up @@ -49,6 +50,7 @@ export const IncidentType = new GraphQLObjectType({
nlp_similar_incidents: { type: new GraphQLList(NlpSimilarIncidentType) },
reports: getListRelationshipConfig(ReportType, GraphQLInt, 'reports', 'report_number', 'reports', 'aiidprod'),
tsne: { type: TsneType },
created_at: { type: GraphQLDateTime },
},
});

Expand Down

0 comments on commit 6aaf382

Please sign in to comment.