gatsby-source-notion-churnotion 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,7 +102,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
102
102
  id: tagNodeId,
103
103
  tag_name: tagData.name,
104
104
  color: tagData.color,
105
- churnotions: [], // 연결된 페이지 리스트 초기화
105
+ children: [],
106
106
  internal: {
107
107
  type: constants_1.NODE_TYPE.Tag,
108
108
  contentDigest: crypto_1.default
@@ -145,13 +145,14 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
145
145
  };
146
146
  await createNode(postNode);
147
147
  // book과 post 부모-자식 관계 설정
148
- const bookNode = getNode(bookId);
148
+ const bookNodeId = createNodeId(`${bookId}-book`);
149
+ const bookNode = getNode(bookNodeId);
149
150
  if (bookNode) {
150
151
  createParentChildLink({
151
152
  parent: bookNode,
152
153
  child: postNode,
153
154
  });
154
- reporter.info(`[SUCCESS] Linked tag: ${bookNode.book_name} -> page: ${postNode.title}`);
155
+ reporter.info(`[SUCCESS] Linked book: ${bookNode.book_name} -> page: ${postNode.title}`);
155
156
  }
156
157
  // tag와 post 부모-자식 관계 설정
157
158
  tagIds.forEach((tagId) => {
@@ -25,7 +25,7 @@ const createSchemaCustomization = ({ actions }) => {
25
25
  id: ID!
26
26
  tag_name: String!
27
27
  color: String!
28
- churnotions: [${constants_1.NODE_TYPE.Post}] @link(by: "id", from: "tags")
28
+ children: [${constants_1.NODE_TYPE.Post}] @link(by: "id", from: "tags")
29
29
  }
30
30
 
31
31
  type ${constants_1.NODE_TYPE.Category} implements Node {
@@ -34,6 +34,7 @@ const createSchemaCustomization = ({ actions }) => {
34
34
  category_name: String!
35
35
  slug: String!
36
36
  children: [${constants_1.NODE_TYPE.Category}!]! @link(by: "parent")
37
+ churnotions: [${constants_1.NODE_TYPE.Post}] @link(by: "book", from: "id")
37
38
  }
38
39
 
39
40
  type ${constants_1.NODE_TYPE.Book} implements Node {
@@ -41,6 +42,7 @@ const createSchemaCustomization = ({ actions }) => {
41
42
  book_name: String!
42
43
  create_date: Date! @dateformat
43
44
  update_date: Date! @dateformat
45
+ children: [${constants_1.NODE_TYPE.Post}] @link(by: "book", from: "id")
44
46
  }
45
47
  `);
46
48
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby-source-notion-churnotion",
3
3
  "description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
4
- "version": "1.0.11",
4
+ "version": "1.0.13",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",