Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commitea6d55c

Browse files
committed
fix(article): graphql interface for meta
1 parentdc2ab74 commitea6d55c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎lib/groupher_server_web/schema/cms/cms_metrics.ex‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ defmodule GroupherServerWeb.Schema.CMS.Metrics do
1818
field(:title,:string)
1919
field(:views,:integer)
2020
field(:upvotes_count,:integer)
21+
field(:meta,:article_meta)
2122

2223
# 这里只是遵循 absinthe 的规范,并不是指返回以下的字段
2324
resolve_type(fnparent_module,_->module_to_atom(parent_module)end)

‎test/groupher_server_web/mutation/cms/upvotes/post_upvote_test.exs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,22 @@ defmodule GroupherServer.Test.Mutation.Upvotes.PostUpvote do
4040
mutation($id: ID!) {
4141
undoUpvotePost(id: $id) {
4242
id
43+
meta {
44+
latestUpvotedUsers {
45+
login
46+
}
47+
}
4348
}
4449
}
4550
"""
46-
51+
@tag:wip
4752
test"login user can undo upvote to a post",~m(user_conn post user)ado
4853
{:ok,_}=CMS.upvote_article(:post,post.id,user)
4954

5055
variables=%{id:post.id}
5156
updated=user_conn|>mutation_result(@query,variables,"undoUpvotePost")
5257

58+
assertuser_exist_in?(user,get_in(updated,["meta","latestUpvotedUsers"]))
5359
assertupdated["id"]==to_string(post.id)
5460
end
5561

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp