Skip to content

Commit

Permalink
fix(models): support legacy article & article replies
Browse files Browse the repository at this point in the history
- Their createdAt are null, so the field should be nullable.
  • Loading branch information
MrOrz committed Oct 25, 2023
1 parent 3a215c4 commit ff17420
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/graphql/models/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ const Article = new GraphQLObjectType({
fields: () => ({
id: { type: new GraphQLNonNull(GraphQLID) },
text: { type: GraphQLString },
createdAt: { type: new GraphQLNonNull(GraphQLString) },
createdAt: {
type: GraphQLString,
description: 'May be null for legacy articles',
},
updatedAt: { type: GraphQLString },
status: { type: new GraphQLNonNull(ReplyRequestStatusEnum) },
references: { type: new GraphQLList(ArticleReference) },
Expand Down
5 changes: 4 additions & 1 deletion src/graphql/models/ArticleReply.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ export default new GraphQLObjectType({
resolve: ({ status }) => (status === undefined ? 'NORMAL' : status),
},

createdAt: { type: new GraphQLNonNull(GraphQLString) },
createdAt: {
type: GraphQLString,
description: 'May be null for legacy articles',
},
updatedAt: { type: GraphQLString },
}),
});

0 comments on commit ff17420

Please sign in to comment.