mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-02 03:00:32 -04:00
Fix backend build and add graphql codegen watch to web:dev
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
"scripts": {
|
||||
"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",
|
||||
"update-schema": "yarn get-schema && yarn generate",
|
||||
"generate": "graphql-codegen --config=graphql-codegen-gql.yaml && graphql-codegen --config=graphql-codegen-typescript.yaml",
|
||||
"prepare": "yarn generate"
|
||||
"generate": "graphql-codegen --config=graphql-codegen-gql.yaml && graphql-codegen --config=graphql-codegen-typescript.yaml"
|
||||
},
|
||||
"dependencies": {
|
||||
"graphql-tag": "^2.10.4"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
"build": "tsc -b",
|
||||
"dev": "yarn build --watch",
|
||||
"typecheck": "yarn build",
|
||||
"prepare": "yarn build",
|
||||
"precommit": "yarn lint-staged"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
10
packages/web/.eslintrc.json
Normal file
10
packages/web/.eslintrc.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["./graphql/*.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next",
|
||||
"dev": "concurrently \"next\" \"yarn generate --watch\"",
|
||||
"build": "next build && next export",
|
||||
"start": "next start",
|
||||
"typecheck": "tsc",
|
||||
|
||||
@@ -37,7 +37,9 @@ const PlayerPage: React.FC<Props> = ({ player }) => {
|
||||
|
||||
export default PlayerPage;
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
type QueryParams = { username: string };
|
||||
|
||||
export const getStaticPaths: GetStaticPaths<QueryParams> = async () => {
|
||||
const players = await getPlayers();
|
||||
|
||||
return {
|
||||
@@ -49,7 +51,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
};
|
||||
|
||||
export const getStaticProps = async (
|
||||
context: GetStaticPropsContext<{ username: string }>,
|
||||
context: GetStaticPropsContext<QueryParams>,
|
||||
) => {
|
||||
const username = context.params?.username;
|
||||
const player = await getPlayer(username);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export type Pokemon = { name: string; image: string };
|
||||
Reference in New Issue
Block a user