ba me oi con thanh cong roi
This commit is contained in:
@@ -9,12 +9,15 @@ import type PrismaTypes from '../types/pothos.generated';
|
||||
import { getDatamodel } from '../types/pothos.generated';
|
||||
import { DateTimeResolver, JSONObjectResolver } from 'graphql-scalars';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js';
|
||||
import type { FileUpload } from 'graphql-upload/processRequest.js';
|
||||
import { PrismaCrudGenerator } from './graphql.generator';
|
||||
|
||||
import { PubSub } from 'graphql-subscriptions';
|
||||
export interface SchemaContext {
|
||||
req: Request;
|
||||
res: Response;
|
||||
generator: PrismaCrudGenerator<BuilderTypes>;
|
||||
pubSub: PubSub;
|
||||
}
|
||||
|
||||
export interface SchemaBuilderOption {
|
||||
@@ -30,6 +33,10 @@ export interface SchemaBuilderOption {
|
||||
Input: JSON;
|
||||
Output: JSON;
|
||||
};
|
||||
Upload: {
|
||||
Input: FileUpload;
|
||||
Output: FileUpload;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -51,6 +58,7 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
this.generator = new PrismaCrudGenerator<BuilderTypes>(this);
|
||||
this.addScalarType('DateTime', DateTimeResolver);
|
||||
this.addScalarType('Json', JSONObjectResolver);
|
||||
this.addScalarType('Upload', GraphQLUpload);
|
||||
|
||||
this.queryType({});
|
||||
this.mutationType({});
|
||||
|
||||
Reference in New Issue
Block a user