mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Set up GQL client
This commit is contained in:
parent
ec77cb1d24
commit
6833439a4a
14 changed files with 1349 additions and 418 deletions
27
codegen.ts
Normal file
27
codegen.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { type CodegenConfig } from '@graphql-codegen/cli'
|
||||
import { defineConfig } from '@eddeee888/gcg-typescript-resolver-files'
|
||||
|
||||
const config: CodegenConfig = {
|
||||
schema: 'src/graphql/typeDefs/**/*.graphql',
|
||||
documents: ['src/**/*.{astro,ts,tsx,mts}'],
|
||||
generates: {
|
||||
'./src/graphql/__generated__/client/': {
|
||||
preset: 'client',
|
||||
plugins: [],
|
||||
presetConfig: { gqlTagName: 'gql' },
|
||||
config: { useTypeImports: true }
|
||||
},
|
||||
'./src/graphql/__generated__/': defineConfig({
|
||||
resolverGeneration: 'disabled',
|
||||
typesPluginsConfig: {
|
||||
contextType: '../client.mts#ResolverContext',
|
||||
},
|
||||
add: {
|
||||
'./types.generated.ts': { content: '// @ts-nocheck' },
|
||||
},
|
||||
})
|
||||
},
|
||||
ignoreNoDocuments: true
|
||||
}
|
||||
|
||||
export default config
|
||||
Loading…
Add table
Add a link
Reference in a new issue