Skip to content

Commit

Permalink
Authenticate GraphQL schema requests
Browse files Browse the repository at this point in the history
  • Loading branch information
moiri-gamboni committed Jan 27, 2024
1 parent c4b1602 commit 2accb34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import type { CodegenConfig } from '@graphql-codegen/cli'
import { loadEnvConfig } from '@next/env'

const _env = loadEnvConfig(process.cwd())
loadEnvConfig(process.cwd())

const config: CodegenConfig = {
overwrite: true,
schema: process.env.WORDPRESS_API_URL,
schema: {
[process.env.WORDPRESS_API_URL]: {
headers: {
Authorization: `Bearer ${process.env.WORDPRESS_AUTH_REFRESH_TOKEN}`,
},
},
},
documents: 'lib/api.ts',
ignoreNoDocuments: true,
generates: {
Expand Down
4 changes: 4 additions & 0 deletions client/lib/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3271,6 +3271,8 @@ export type MenuToMenuItemConnectionWhereArgs = {
export enum MimeTypeEnum {
/** application/java mime type. */
ApplicationJava = 'APPLICATION_JAVA',
/** application/javascript mime type. */
ApplicationJavascript = 'APPLICATION_JAVASCRIPT',
/** application/msword mime type. */
ApplicationMsword = 'APPLICATION_MSWORD',
/** application/octet-stream mime type. */
Expand Down Expand Up @@ -3409,6 +3411,8 @@ export enum MimeTypeEnum {
TextCss = 'TEXT_CSS',
/** text/csv mime type. */
TextCsv = 'TEXT_CSV',
/** text/html mime type. */
TextHtml = 'TEXT_HTML',
/** text/plain mime type. */
TextPlain = 'TEXT_PLAIN',
/** text/richtext mime type. */
Expand Down

0 comments on commit 2accb34

Please sign in to comment.