Skip to content

Commit

Permalink
[WIP] Ticket CV2-6158: Adding author field to FactCheckType and `…
Browse files Browse the repository at this point in the history
…ExplainerType`
  • Loading branch information
caiosba committed Feb 12, 2025
1 parent a7ccd92 commit 38730fa
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/graph/types/explainer_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ class ExplainerType < DefaultObject
field :team, PublicTeamType, null: true
field :tags, [GraphQL::Types::String, null: true], null: true
field :trashed, GraphQL::Types::Boolean, null: true

field :author, UserType, null: true

# FIXME: Return actual article creator
def author
object.user
end
end
7 changes: 7 additions & 0 deletions app/graph/types/fact_check_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ class FactCheckType < DefaultObject
field :imported, GraphQL::Types::Boolean, null: true
field :report_status, GraphQL::Types::String, null: true
field :trashed, GraphQL::Types::Boolean, null: true

field :author, UserType, null: true

# FIXME: Return actual article creator
def author
object.user
end
end
2 changes: 2 additions & 0 deletions lib/relay.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8261,6 +8261,7 @@ type Dynamic_annotation_verification_statusEdge {
Explainer type
"""
type Explainer implements Node {
author: User
created_at: String
dbid: Int
description: String
Expand Down Expand Up @@ -8413,6 +8414,7 @@ type ExtractTextPayload {
FactCheck type
"""
type FactCheck implements Node {
author: User
claim_description: ClaimDescription
created_at: String
dbid: Int
Expand Down
28 changes: 28 additions & 0 deletions public/relay.json
Original file line number Diff line number Diff line change
Expand Up @@ -44673,6 +44673,20 @@
"name": "Explainer",
"description": "Explainer type",
"fields": [
{
"name": "author",
"description": null,
"args": [

],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "created_at",
"description": null,
Expand Down Expand Up @@ -45485,6 +45499,20 @@
"name": "FactCheck",
"description": "FactCheck type",
"fields": [
{
"name": "author",
"description": null,
"args": [

],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "claim_description",
"description": null,
Expand Down

0 comments on commit 38730fa

Please sign in to comment.