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

View File

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