"message": "This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of application/x-www-form-urlencoded, multipart/form-data, text/plain) or provide a non-empty value for one of the following headers: x-apollo-operation-name, apollo-require-preflight\n",
"extensions": {
"code": "BAD_REQUEST",
"stacktrace": [
"BadRequestError: This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of application/x-www-form-urlencoded, multipart/form-data, text/plain) or provide a non-empty value for one of the following headers: x-apollo-operation-name, apollo-require-preflight",
"",
" at new GraphQLErrorWithCode (F:\\products\\graph\\node_modules\\@apollo\\server\\src\\internalErrorClasses.ts:15:5)",
" at new BadRequestError (F:\\products\\graph\\node_modules\\@apollo\\server\\src\\internalErrorClasses.ts:116:5)",
" at preventCsrf (F:\\products\\graph\\node_modules\\@apollo\\server\\src\\preventCsrf.ts:91:9)",
" at ApolloServer.executeHTTPGraphQLRequest (F:\\products\\graph\\node_modules\\@apollo\\server\\src\\ApolloServer.ts:1048:20)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)"
]
}
}
]
}
Когда я отправляю запрос на http://localhost:3000/graphql, появляется эта ошибка, как я могу это предотвратить?
Please either specify a 'content-type' header (with a type that is not one of application/x-www-form-urlencoded, multipart/form-data, text/plain) or provide a non-empty value for one of the following headers: x-apollo-operation-name, apollo-require-preflight
Обсуждают сегодня