-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure codegen at repository's root
- Loading branch information
1 parent
85c6b72
commit c9b04d2
Showing
3 changed files
with
2,133 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable turbo/no-undeclared-env-vars */ | ||
|
||
import type { CodegenConfig } from '@graphql-codegen/cli'; | ||
|
||
const HASURA_GRAPHQL_ADMIN_SECRET = "" | ||
const HASURA_GRAPHQL_ENDPOINT = ""; | ||
|
||
|
||
const config: CodegenConfig = { | ||
overwrite: true, | ||
schema: [HASURA_GRAPHQL_ENDPOINT, | ||
{ | ||
[HASURA_GRAPHQL_ENDPOINT]: { | ||
headers: { | ||
"x-hasura-access-key": HASURA_GRAPHQL_ADMIN_SECRET, | ||
}, | ||
}, | ||
} | ||
], | ||
documents: "packages/lib/graphql/**/*.ts", | ||
generates: { | ||
'./packages/lib/graphql/globalTypes.ts': { | ||
preset: 'client' | ||
} | ||
} | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,33 @@ | |
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"lint": "turbo run lint", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"" | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
"codegen": "graphql-codegen --config codegen.ts" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/cli": "^5.0.0", | ||
"@graphql-codegen/client-preset": "^4.1.0", | ||
"@graphql-codegen/introspection": "4.0.0", | ||
"@graphql-codegen/typescript": "^4.0.1", | ||
"@graphql-codegen/typescript-resolvers": "^4.0.1", | ||
"@parcel/watcher": "^2.3.0", | ||
"@turbo/gen": "^1.9.7", | ||
"add": "^2.0.6", | ||
"eslint": "^7.32.0", | ||
"eslint-config-custom": "*", | ||
"prettier": "^2.5.1", | ||
"turbo": "latest" | ||
"ts-node": "^10.9.2", | ||
"turbo": "latest", | ||
"typescript": "^5.3.3", | ||
"yarn": "^1.22.21" | ||
}, | ||
"name": "sahil", | ||
"packageManager": "[email protected]", | ||
"workspaces": [ | ||
"apps/*", | ||
"packages/*" | ||
] | ||
], | ||
"dependencies": { | ||
"graphql": "^16.8.1" | ||
} | ||
} |
Oops, something went wrong.