Skip to content

Instantly share code, notes, and snippets.

@2wce
Created January 6, 2023 16:57
Show Gist options
  • Save 2wce/9e44b3c9a54f62ac521947be4ea851a1 to your computer and use it in GitHub Desktop.
Save 2wce/9e44b3c9a54f62ac521947be4ea851a1 to your computer and use it in GitHub Desktop.
import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: [
{
[process.env.API_URL]: {
headers: {
Authorization: `Bearer ${process.env.TOKEN}`
}
}
}
],
generates: {
'./src/generated/index.ts': {
plugins: [
'typescript',
'typescript-operations',
'typescript-react-apollo'
],
config: {
noHOC: true,
noComponents: true,
noNamespaces: true,
withHooks: true,
withSubscriptionHooks: true
}
}
},
documents: 'src/graphql/**/*.graphql',
overwrite: true
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment