mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(server): default page owner (#10015)
This commit is contained in:
@@ -39,15 +39,16 @@ export class PaginationInput {
|
||||
'returns the elements in the list that come after the specified cursor.',
|
||||
middleware: [parseCursorMiddleware],
|
||||
})
|
||||
after!: string | null;
|
||||
after?: string | null;
|
||||
|
||||
@Field(() => String, {
|
||||
nullable: true,
|
||||
description:
|
||||
'returns the elements in the list that come before the specified cursor.',
|
||||
middleware: [parseCursorMiddleware],
|
||||
})
|
||||
before!: string | null;
|
||||
// NOT IMPLEMENTED YET
|
||||
// @Field(() => String, {
|
||||
// nullable: true,
|
||||
// description:
|
||||
// 'returns the elements in the list that come before the specified cursor.',
|
||||
// middleware: [parseCursorMiddleware],
|
||||
// })
|
||||
// before?: string | null;
|
||||
}
|
||||
|
||||
const encode = (input: string) => Buffer.from(input).toString('base64');
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
import { Type } from '@nestjs/common';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, FieldOptions, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { ApplyType } from '../utils/types';
|
||||
|
||||
export function registerObjectType<T>(
|
||||
fields: Record<string, Type<any>>,
|
||||
fields: Record<
|
||||
string,
|
||||
{
|
||||
type: () => Type<any>;
|
||||
options?: FieldOptions;
|
||||
}
|
||||
>,
|
||||
options: {
|
||||
name: string;
|
||||
}
|
||||
) {
|
||||
const Inner = ApplyType<T>();
|
||||
for (const [key, value] of Object.entries(fields)) {
|
||||
Field(() => value)(Inner.prototype, key);
|
||||
for (const [key, { type, options }] of Object.entries(fields)) {
|
||||
Field(type, options)(Inner.prototype, key);
|
||||
}
|
||||
|
||||
ObjectType(options.name)(Inner);
|
||||
|
||||
Reference in New Issue
Block a user