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:
@ -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', () => {
|
||||
|
||||
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user