Fix cursor generation buffer dependency in front (#9101)

Buffer is part of nodejs API and is not recognized by front js runner.
buffer library (already installed) is providing a polyfill for that
This commit is contained in:
Charles Bochet
2024-12-17 13:42:41 +01:00
committed by GitHub
parent 582530ef1e
commit 8bb699cbc2
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import { encodeCursor } from '@/apollo/utils/encodeCursor';
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { Buffer } from 'buffer';
describe('encodeCursor', () => {
it('should create a cursor with id only', () => {

View File

@ -1,6 +1,8 @@
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { isDefined } from '~/utils/isDefined';
import { Buffer } from 'buffer';
export const encodeCursor = (record: ObjectRecord) => {
if (!('id' in record) || !isDefined(record.id)) {
throw new Error('Record does not have an id');