@ -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: [
|
||||||
|
|||||||
Reference in New Issue
Block a user