Skip to content

Commit

Permalink
fix(scalars.ts): remove Bytes encode def
Browse files Browse the repository at this point in the history
  • Loading branch information
moconnell committed Jan 29, 2024
1 parent efb0c9d commit b311252
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/graphql/src/scalars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit b311252

Please # to comment.