mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
Return null cursor when creating comment
This commit is contained in:
@@ -39,7 +39,7 @@ beforeEach(() => {
|
||||
.returns({
|
||||
// TODO: add a type assertion here to ensure that if the type changes, that the test will fail
|
||||
edge: {
|
||||
cursor: "2018-07-06T18:24:00.000Z",
|
||||
cursor: null,
|
||||
node: {
|
||||
id: "comment-x",
|
||||
author: users[0],
|
||||
|
||||
@@ -39,7 +39,7 @@ beforeEach(() => {
|
||||
})
|
||||
.returns({
|
||||
edge: {
|
||||
cursor: "2018-07-06T18:24:00.000Z",
|
||||
cursor: null,
|
||||
node: {
|
||||
id: "comment-x",
|
||||
author: users[0],
|
||||
|
||||
@@ -9,8 +9,11 @@ const Mutation: GQLMutationTypeResolver<void> = {
|
||||
const comment = await ctx.mutators.Comment.create(input);
|
||||
return {
|
||||
edge: {
|
||||
// FIXME: (wyattjoh) when we're using a replies/respect sort, it is index based instead of date based, needs some work!
|
||||
cursor: comment.created_at,
|
||||
// (cvle)
|
||||
// Depending on the sort we can't determine the accurate cursor
|
||||
// in a performant way, so we return null instead.
|
||||
// It seems that Relay does not directly use this value...
|
||||
cursor: null,
|
||||
node: comment,
|
||||
},
|
||||
clientMutationId: input.clientMutationId,
|
||||
|
||||
@@ -679,7 +679,7 @@ type CommentEdge {
|
||||
"""
|
||||
|
||||
"""
|
||||
cursor: Cursor!
|
||||
cursor: Cursor
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user