From ac08fb74c8f7a52d47e2c31621908f01c06b1076 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 11 Mar 2026 17:31:05 -0700 Subject: [PATCH] fix(rnetwork): update GraphQL queries for Twenty schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - email → emails (composite Emails type) - phone → phones (composite Phones type) - company name is String, not FullName (no subfields) Co-Authored-By: Claude Opus 4.6 --- modules/rnetwork/mod.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/rnetwork/mod.ts b/modules/rnetwork/mod.ts index dc73dbb..1ce16b2 100644 --- a/modules/rnetwork/mod.ts +++ b/modules/rnetwork/mod.ts @@ -86,10 +86,10 @@ routes.get("/api/people", async (c) => { node { id name { firstName lastName } - email { primaryEmail } - phone { primaryPhoneNumber } + emails { primaryEmail } + phones { primaryPhoneNumber } city - company { id name { firstName lastName } } + company { id name } createdAt } } @@ -162,9 +162,9 @@ routes.get("/api/graph", async (c) => { node { id name { firstName lastName } - email { primaryEmail } + emails { primaryEmail } city - company { id name { firstName lastName } } + company { id name } } } } @@ -203,7 +203,7 @@ routes.get("/api/graph", async (c) => { // People → nodes for (const { node: p } of d.people?.edges || []) { const label = [p.name?.firstName, p.name?.lastName].filter(Boolean).join(" ") || "Unknown"; - nodes.push({ id: p.id, label, type: "person", data: { email: p.email?.primaryEmail, location: p.city } }); + nodes.push({ id: p.id, label, type: "person", data: { email: p.emails?.primaryEmail, location: p.city } }); nodeIds.add(p.id); // Person → Company edge