chore: added code generation config

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
mirlan.maksitaliev 6 years ago
parent 3fb655dd13
commit 529181c021
  1. 22
      codegen.yml
  2. 16
      package.json

@ -0,0 +1,22 @@
overwrite: true
schema: ''
documents: src/api/operations/**/*.graphql
generates:
src/types/index.tsx:
plugins:
- typescript
src/:
preset:
near-operation-file
presetConfig:
extension: .tsx
baseTypesPath: types
plugins:
- typescript-operations
- typescript-react-apollo
config:
withComponent: false
withHOC: false
withHooks: true
config:
typesPrefix: T

@ -3,12 +3,19 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"prestart ": "yarn generate",
"start": "react-scripts start", "start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=false react-scripts build && gzipper --verbose ./build", "build": "GENERATE_SOURCEMAP=false react-scripts build && gzipper --verbose ./build",
"test": "react-scripts test --passWithNoTests --watchAll=false", "test": "react-scripts test --passWithNoTests --watchAll=false",
"eject": "react-scripts eject" "eject": "react-scripts eject",
"generate": "graphql-codegen --config codegen.yml"
}, },
"dependencies": { "dependencies": {
"@apollo/react-common": "^3.1.4",
"@apollo/react-hooks": "^3.1.5",
"apollo-boost": "^0.4.9",
"graphql": "^15.0.0",
"lodash": "^4.17.15",
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
"react-scripts": "3.4.1" "react-scripts": "3.4.1"
@ -16,10 +23,17 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^8.3.5", "@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4", "@commitlint/config-conventional": "^8.3.4",
"@graphql-codegen/cli": "1.15.0",
"@graphql-codegen/import-types-preset": "^1.15.0",
"@graphql-codegen/near-operation-file-preset": "^1.15.0",
"@graphql-codegen/typescript": "1.15.0",
"@graphql-codegen/typescript-operations": "1.15.0",
"@graphql-codegen/typescript-react-apollo": "1.15.0",
"@testing-library/jest-dom": "^4.2.4", "@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2", "@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2", "@testing-library/user-event": "^7.1.2",
"@types/jest": "^24.0.0", "@types/jest": "^24.0.0",
"@types/lodash": "^4.14.154",
"@types/node": "^12.0.0", "@types/node": "^12.0.0",
"@types/react": "^16.9.0", "@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0", "@types/react-dom": "^16.9.0",

Loading…
Cancel
Save