Skip to content

Commit

Permalink
Commit graphql schema and use literals instead ts enums (#254)
Browse files Browse the repository at this point in the history
* Commit graphql schema and use literals instead ts enums

* Add worflow to check for changes in generated GraphQL files

* Update workflow

* dont generate graphql on build

* add gitattributes

---------

Co-authored-by: Krzysztof Żuraw <[email protected]>
  • Loading branch information
lkostrowski and krzysztofzuraw authored Oct 30, 2024
1 parent 11467d0 commit 48d3b55
Show file tree
Hide file tree
Showing 7 changed files with 140,429 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
generated/** linguist-generated=true
24 changes: 8 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- uses: actions/setup-node@v4
- name: Setup PNPM
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-
- name: Install dependencies
run: pnpm install
- name: Generate GraphQL types
run: pnpm generate
run_install: |
- args: [--frozen-lockfile]
- name: Lint
run: pnpm lint
- name: Check types
run: pnpm check-types
- name: Check for changes in generated GraphQL files
run: |
pnpm generate
git diff --name-status --exit-code .
- name: Test
run: pnpm test
- name: Build project
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ yarn-error.log*
.vscode
.idea

# GraphQL auto-generated
generated/

# Sentry
.sentryclirc

Expand Down
2 changes: 2 additions & 0 deletions .graphqlrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ extensions:
generated/graphql.ts:
config:
dedupeFragments: true
# Reduces bundle size
enumsAsTypes: true
plugins:
- typescript
- typescript-operations
Expand Down
Loading

0 comments on commit 48d3b55

Please sign in to comment.