fix(rnetwork): update GraphQL queries for Twenty schema
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
97ed8eff3a
commit
ac08fb74c8
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue