From dfd08e7c5572f58e32c89b7c4149ce7166d33e65 Mon Sep 17 00:00:00 2001
From: Jarred Sumner <jarred@jarredsumner.com>
Date: Thu, 7 Oct 2021 21:31:11 -0700
Subject: Fix potential symbol collision in `bun-macro-relay`

---
 packages/bun-macro-relay/bun-macro-relay.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'packages/bun-macro-relay/bun-macro-relay.tsx')

diff --git a/packages/bun-macro-relay/bun-macro-relay.tsx b/packages/bun-macro-relay/bun-macro-relay.tsx
index d6c9cb0a7..6c12c1f45 100644
--- a/packages/bun-macro-relay/bun-macro-relay.tsx
+++ b/packages/bun-macro-relay/bun-macro-relay.tsx
@@ -67,9 +67,11 @@ export function graphql(node) {
     throw new Error("GraphQL operations and fragments must contain names");
   }
 
+  const identifiername = `${definitionName}_$gql`;
+
   const importStmt = (
     <import
-      default={definitionName}
+      default={identifiername}
       path={`${artifactDirectory}/${definitionName}.graphql`}
     />
   );
@@ -77,7 +79,7 @@ export function graphql(node) {
   return (
     <>
       <inject>{importStmt}</inject>
-      <id to={importStmt.namespace[definitionName]} pure />
+      <id to={importStmt.namespace[identifiername]} pure />
     </>
   );
 }
-- 
cgit v1.2.3

