Skip to content

Commit 4b00d58

Browse files
authored
Merge pull request #324 from cofacts/nullable-createdat
Nullable createdat
2 parents 3a215c4 + 5636d7a commit 4b00d58

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/graphql/models/Article.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ const Article = new GraphQLObjectType({
6161
fields: () => ({
6262
id: { type: new GraphQLNonNull(GraphQLID) },
6363
text: { type: GraphQLString },
64-
createdAt: { type: new GraphQLNonNull(GraphQLString) },
64+
createdAt: {
65+
type: GraphQLString,
66+
description: 'May be null for legacy articles',
67+
},
6568
updatedAt: { type: GraphQLString },
6669
status: { type: new GraphQLNonNull(ReplyRequestStatusEnum) },
6770
references: { type: new GraphQLList(ArticleReference) },

src/graphql/models/ArticleReply.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export default new GraphQLObjectType({
134134
resolve: ({ status }) => (status === undefined ? 'NORMAL' : status),
135135
},
136136

137-
createdAt: { type: new GraphQLNonNull(GraphQLString) },
137+
createdAt: {
138+
type: GraphQLString,
139+
description: 'May be null for legacy article-replies',
140+
},
138141
updatedAt: { type: GraphQLString },
139142
}),
140143
});

src/graphql/models/Reply.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ const Reply = new GraphQLObjectType({
3131
description: 'The user submitted this reply version',
3232
resolve: userFieldResolver,
3333
},
34-
createdAt: { type: new GraphQLNonNull(GraphQLString) },
34+
createdAt: {
35+
type: GraphQLString,
36+
description: 'May be null for legacy replies',
37+
},
3538
text: { type: GraphQLString },
3639
type: { type: new GraphQLNonNull(ReplyTypeEnum) },
3740
reference: { type: GraphQLString },

0 commit comments

Comments
 (0)