Fix graphql codegen

This commit is contained in:
Hammad Jutt
2020-04-18 00:43:06 -06:00
parent 1c5955ce32
commit 545b243f87
7 changed files with 3062 additions and 25 deletions

View File

@@ -1,7 +1,9 @@
import gql from 'graphql-tag';
export const Player = gql`
fragment Player on Player {
id
}
fragment Player on Player {
id
rank
totalXp
}
`;

View File

@@ -1,5 +1,5 @@
schema:
- http://localhost:8080/v1/graphql
- ./schema.graphql
documents:
overwrite: true
config:
@@ -17,10 +17,7 @@ generates:
typescriptCodegenOutputPath: ../
trimString:
withQueries: true
withSubscriptions: false
withInserts: false
withUpdates: false
withDeletes: false
./autogen/graphql.schema.json:
plugins:
- introspection
withSubscriptions: true
withInserts: true
withUpdates: true
withDeletes: true

View File

@@ -1,5 +1,5 @@
schema:
- ./autogen/graphql.schema.json
- ./schema.graphql
overwrite: true
config:
scalars:
@@ -8,8 +8,8 @@ config:
generates:
./autogen/index.tsx:
documents:
- ./customFragments.ts
- ./autogen/hasura/gql.ts
- ./**/*.tsx
- ./**/*.ts
plugins:
- typescript
- typescript-operations
@@ -32,10 +32,10 @@ generates:
trimString:
withClientAndCacheHelpers: true
withQueries: true
withSubscriptions: false
withInserts: false
withUpdates: false
withDeletes: false
withSubscriptions: true
withInserts: true
withUpdates: true
withDeletes: true
./autogen/hasura/react.ts:
documents:
- ./customFragments.ts
@@ -46,10 +46,10 @@ generates:
typescriptCodegenOutputPath: "../"
trimString:
withQueries: true
withSubscriptions: false
withInserts: false
withUpdates: false
withDeletes: false
withSubscriptions: true
withInserts: true
withUpdates: true
withDeletes: true
./autogen/hasura/config.ts:
documents:
- ./customFragments.ts

View File

@@ -2,16 +2,21 @@
"name": "@the-game/graphql-codegen",
"version": "1.0.0",
"license": "MIT",
"engines": {
"node": ">=12.x.x"
},
"scripts": {
"generate": "graphql-codegen --config=graphql-codegen-gql.yaml; graphql-codegen --config=graphql-codegen-typescript.yaml",
"get-schema": "env-cmd -f ../../.env -x get-graphql-schema -h x-hasura-admin-secret=\\$HASURA_GRAPHQL_ADMIN_SECRET http://localhost:8080/v1/graphql > schema.graphql",
"generate": "yarn get-schema && graphql-codegen --config=graphql-codegen-gql.yaml && graphql-codegen --config=graphql-codegen-typescript.yaml",
"typecheck": "echo noop"
},
"dependencies": {
"devDependencies": {
"@graphql-codegen/cli": "^1.13.2",
"@graphql-codegen/introspection": "^1.13.2",
"@graphql-codegen/typescript": "^1.13.2",
"@graphql-codegen/typescript-operations": "^1.13.2",
"@graphql-codegen/typescript-react-apollo": "^1.13.2",
"env-cmd": "^10.1.0",
"graphql-codegen-hasura-client-config": "^4.8.3",
"graphql-codegen-hasura-core": "^4.8.3",
"graphql-codegen-hasura-gql": "^4.8.3",

File diff suppressed because it is too large Load Diff