update header x-apollo-operation-name

This commit is contained in:
2024-10-15 02:19:10 +07:00
parent dc81f6eaa8
commit 7cfab52e77
3 changed files with 8 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ export class UploadedFileSchema extends PothosSchema {
@Pothos() @Pothos()
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
uploadedDocument: t.prismaField({ uploadedFile: t.prismaField({
type: this.uploadedFile(), type: this.uploadedFile(),
args: this.builder.generator.findUniqueArgs('UploadedFile'), args: this.builder.generator.findUniqueArgs('UploadedFile'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
@@ -59,7 +59,7 @@ export class UploadedFileSchema extends PothosSchema {
return file; return file;
}, },
}), }),
uploadedDocuments: t.prismaField({ uploadedFiles: t.prismaField({
type: [this.uploadedFile()], type: [this.uploadedFile()],
args: this.builder.generator.findManyArgs('UploadedFile'), args: this.builder.generator.findManyArgs('UploadedFile'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {

View File

@@ -10,7 +10,11 @@ async function bootstrap() {
app.enableCors({ app.enableCors({
origin: corsOrigin, origin: corsOrigin,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'], methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'], allowedHeaders: [
'Content-Type',
'Authorization',
'x-apollo-operation-name',
],
credentials: true, credentials: true,
}); });