Skip to content

Commit

Permalink
fix: 🔥 experiment typescript types from gql
Browse files Browse the repository at this point in the history
+ SWR Hooks (with types)
  • Loading branch information
melMass committed Feb 22, 2023
1 parent 1084c0a commit 718caf3
Show file tree
Hide file tree
Showing 22 changed files with 13,944 additions and 536 deletions.
36 changes: 36 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { CodegenConfig } from '@graphql-codegen/cli'

const plugins = [
'typescript',
'typescript-operations',
// 'typed-document-node',
'typescript-graphql-request',
'plugin-typescript-swr',
]
const config = {
skipTypename: false,
withHooks: true,
withHOC: false,
withComponent: false,
experimentalFragmentVariables: true,
useTypeImports: true,
commentDescriptions: true,
}
const codeGenConfig: CodegenConfig = {
ignoreNoDocuments: true,
overwrite: true,

schema: 'https://indexer.tzprofiles.com/v1/graphql',
generates: {
'./src/gql/index.ts': {
documents: ['src/data/queries.ts'],
schema: 'https://teztok.teia.rocks/v1/graphql',

// preset: 'client',
plugins,
// schema: 'https://indexer.tzprofiles.com/v1/graphql', // this will get merged
config,
},
},
}
export default codeGenConfig
Loading

0 comments on commit 718caf3

Please sign in to comment.