fix: twenty-chrome-extension:"graphql:generate" (#5649)

fixes: #5645
This commit is contained in:
Aditya Pimpalkar
2024-05-29 13:45:32 +01:00
committed by GitHub
parent df2b76ff6c
commit 008813f194

View File

@@ -1,9 +1,17 @@
import { CodegenConfig } from '@graphql-codegen/cli'; import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = { const config: CodegenConfig = {
schema: ['http://localhost:3000/graphql'], schema: [{
[`${import.meta.env.VITE_SERVER_BASE_URL}/graphql`]: {
// some of the mutations and queries require authorization (people or companies)
// so to regenrate the schema with types we need to pass a auth token
headers: {
Authorization: 'YOUR-TOKEN-HERE',
},
}
}],
overwrite: true, overwrite: true,
documents: ['./src/**/*.ts', '!src/generated/**/*.*'], documents: ['./src/**/*.ts', '!src/generated/**/*.*' ],
generates: { generates: {
'./src/generated/graphql.tsx': { './src/generated/graphql.tsx': {
plugins: [ plugins: [