From b311252d0bd2f738a3f3ee63f935bd5ab5b7d7aa Mon Sep 17 00:00:00 2001 From: Matthew O'Connell Date: Mon, 29 Jan 2024 20:11:34 +0100 Subject: [PATCH] fix(scalars.ts): remove Bytes encode def --- packages/graphql/src/scalars.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/graphql/src/scalars.ts b/packages/graphql/src/scalars.ts index 8922237a..b196f7b5 100644 --- a/packages/graphql/src/scalars.ts +++ b/packages/graphql/src/scalars.ts @@ -10,8 +10,10 @@ export const scalars = ZeusScalars({ decode: (e: unknown) => BigInt(e as string), }, Bytes: { - encode: (e: unknown) => (e as string).replace('0x', ''), - decode: (e: unknown) => `0x${e}`, + decode: (e: unknown) => { + const str = e as string; + return str.startsWith('0x') ? str : `0x${str}`; + }, }, Int8: { encode: (e: unknown) => (e as number).toString(),