Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit de4c437

Browse files
committed
Refactor comment fields for more reusability
1 parent 3056c79 commit de4c437

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
// Query partial: retrieve comment fields.
22
const commentsFields = `
3-
edges {
4-
node {
5-
databaseId
6-
content(format: RENDERED)
7-
parentDatabaseId
8-
approved
9-
id
10-
date
11-
parentId
12-
type
13-
}
14-
}
3+
databaseId
4+
content(format: RENDERED)
5+
parentDatabaseId
6+
approved
7+
id
8+
date
9+
parentId
10+
type
1511
`
1612
export default commentsFields

api/wordpress/_partials/commentsPostFields.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import commentsFields from './commentsFields'
33
// Query partial: retrieve comment post fields.
44
const commentsPostFields = `
55
comments(first: 10) {
6-
${commentsFields}
6+
edges {
7+
node {
8+
${commentsFields}
9+
}
10+
}
711
}
812
`
913
export default commentsPostFields

0 commit comments

Comments
 (0)