Skip to content

Commit 80e4a4f

Browse files
dthyressonTobbe
andauthored
chore: Improved Possible Types DX and Framework integration for GraphQL Fragments with Union and Interface support (#9594)
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
1 parent 5210e06 commit 80e4a4f

File tree

195 files changed

+7373
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+7373
-426
lines changed

.github/workflows/ci.yml

+90
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,96 @@ jobs:
702702
steps:
703703
- run: echo "Skipped"
704704

705+
fragments-smoke-tests:
706+
needs: check
707+
708+
strategy:
709+
matrix:
710+
os: [ubuntu-latest, windows-latest]
711+
712+
name: 📄 Fragments Smoke tests / ${{ matrix.os }}
713+
runs-on: ${{ matrix.os }}
714+
715+
env:
716+
REDWOOD_CI: 1
717+
REDWOOD_VERBOSE_TELEMETRY: 1
718+
719+
steps:
720+
- uses: actions/checkout@v4
721+
722+
- name: Enable Corepack
723+
run: corepack enable
724+
725+
- name: ⬢ Set up Node.js
726+
uses: actions/setup-node@v4
727+
with:
728+
node-version: 20
729+
730+
- name: Enable Corepack
731+
run: corepack enable
732+
733+
- name: 🐈 Set up yarn cache
734+
uses: ./.github/actions/set-up-yarn-cache
735+
736+
- name: 🐈 Yarn install
737+
run: yarn install --inline-builds
738+
env:
739+
GITHUB_TOKEN: ${{ github.token }}
740+
741+
- name: 🔨 Build
742+
run: yarn build
743+
744+
- name: 🌲 Set up test project
745+
id: set-up-test-project
746+
uses: ./.github/actions/set-up-test-project
747+
with:
748+
bundler: vite
749+
canary: true
750+
env:
751+
REDWOOD_DISABLE_TELEMETRY: 1
752+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
753+
754+
- name: Run Fragments codemods on test project
755+
run: npx -y tsx ./tasks/test-project/add-gql-fragments ${{ steps.set-up-test-project.outputs.test-project-path }}
756+
env:
757+
REDWOOD_DISABLE_TELEMETRY: 1
758+
759+
- name: 🎭 Install playwright dependencies
760+
run: npx playwright install --with-deps chromium
761+
762+
- name: Run Fragments dev smoke tests
763+
working-directory: ./tasks/smoke-tests/fragments-dev
764+
run: npx playwright test
765+
env:
766+
REDWOOD_TEST_PROJECT_PATH: '${{ steps.set-up-test-project.outputs.test-project-path }}'
767+
REDWOOD_DISABLE_TELEMETRY: 1
768+
769+
- name: Build for production
770+
working-directory: ${{ steps.set-up-test-project.outputs.test-project-path }}
771+
run: yarn rw build
772+
env:
773+
REDWOOD_DISABLE_TELEMETRY: 1
774+
775+
- name: Run Fragments serve smoke tests
776+
working-directory: ./tasks/smoke-tests/fragments-serve
777+
run: npx playwright test
778+
env:
779+
REDWOOD_TEST_PROJECT_PATH: '${{ steps.set-up-test-project.outputs.test-project-path }}'
780+
REDWOOD_DISABLE_TELEMETRY: 1
781+
782+
fragments-smoke-tests-skip:
783+
needs: detect-changes
784+
785+
strategy:
786+
matrix:
787+
os: [ubuntu-latest, windows-latest]
788+
789+
name: 📄 Fragments Smoke tests / ${{ matrix.os }}
790+
runs-on: ${{ matrix.os }}
791+
792+
steps:
793+
- run: echo "Skipped"
794+
705795
crwa:
706796
needs: check
707797

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# These environment variables will be used by default if you do not create any
2+
# yourself in .env. This file should be safe to check into your version control
3+
# system. Any custom values should go in .env and .env should *not* be checked
4+
# into version control.
5+
6+
# schema.prisma defaults
7+
DATABASE_URL=file:./dev.db
8+
9+
# location of the test database for api service scenarios (defaults to ./.redwood/test.db if not set)
10+
# TEST_DATABASE_URL=file:./.redwood/test.db
11+
12+
# disables Prisma CLI update notifier
13+
PRISMA_HIDE_UPDATE_MESSAGE=true
14+
15+
# Option to override the current environment's default api-side log level
16+
# See: https://redwoodjs.com/docs/logger for level options, defaults to "trace" otherwise.
17+
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
18+
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
19+
# LOG_LEVEL=debug
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# DATABASE_URL=file:./dev.db
2+
# TEST_DATABASE_URL=file:./.redwood/test.db
3+
# PRISMA_HIDE_UPDATE_MESSAGE=true
4+
# LOG_LEVEL=trace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.idea
2+
.DS_Store
3+
.env
4+
.netlify
5+
.redwood/*
6+
!.redwood/README.md
7+
dev.db*
8+
dist
9+
dist-babel
10+
node_modules
11+
yarn-error.log
12+
web/public/mockServiceWorker.js
13+
web/types/graphql.d.ts
14+
api/types/graphql.d.ts
15+
api/src/lib/generateGraphiQLHeader.*
16+
.pnp.*
17+
.yarn/*
18+
!.yarn/patches
19+
!.yarn/plugins
20+
!.yarn/releases
21+
!.yarn/sdks
22+
!.yarn/versions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# .redwood
2+
3+
## What is this directory?
4+
5+
Redwood uses this `.redwood` directory to store transitory data that aids in the smooth and convenient operation of your Redwood project.
6+
7+
## Do I need to do anything with this directory?
8+
9+
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Redwood.
10+
11+
You don't need to commit any other contents of this directory to your version control system. It's ignored by default.
12+
13+
## What's in this directory?
14+
15+
### Files
16+
17+
| Name | Description |
18+
| :---------------- | :------- |
19+
| commandCache.json | This file contains mappings to assist the Redwood CLI in efficiently executing commands. |
20+
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Redwood project. |
21+
| studio.db | The sqlite database used by the experimental `rw exp studio` feature. |
22+
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
23+
| test.db | The sqlite database used when running tests. |
24+
25+
### Directories
26+
27+
| Name | Description |
28+
| :---------- | :------- |
29+
| locks | Stores temporary files that Redwood uses to keep track of the execution of async/background tasks between processes. |
30+
| logs | Stores log files for background tasks such as update checking. |
31+
| prebuild | Stores transpiled JavaScript that is generated as part of Redwood's build process. |
32+
| telemetry | Stores the recent telemetry that the Redwood CLI has generated. You may inspect these files to see everything Redwood is anonymously collecting. |
33+
| types | Stores the results of type generation. |
34+
| updateCheck | Stores a file which contains the results of checking for Redwood updates. |
35+
36+
We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` directory that have not yet been documented here. This is likely nothing to worry about but feel free to let us know and we'll update this list.
37+
38+
### Telemetry
39+
40+
RedwoodJS collects completely anonymous telemetry data about general usage. For transparency, that data is viewable in the respective directories and files. To learn more and manage your project's settings, visit [telemetry.redwoodjs.com](https://telemetry.redwoodjs.com).
41+
42+
### Have any questions?
43+
44+
Feel free to reach out to us in the [RedwoodJS Community](https://community.redwoodjs.com/) forum if you have any questions.

__fixtures__/fragment-test-project/.redwood/schema.graphql

-102
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"eamodio.gitlens",
5+
"ofhumanbondage.react-proptypes-intellisense",
6+
"mgmcdermott.vscode-language-babel",
7+
"wix.vscode-import-cost",
8+
"pflannery.vscode-versionlens",
9+
"editorconfig.editorconfig",
10+
"prisma.prisma",
11+
"graphql.vscode-graphql",
12+
"csstools.postcss",
13+
"bradlc.vscode-tailwindcss"
14+
],
15+
"unwantedRecommendations": []
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"version": "0.3.0",
3+
"configurations": [
4+
{
5+
"command": "yarn redwood dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
6+
"name": "Run Dev Server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
},
10+
{
11+
"name": "Attach API debugger",
12+
"port": 18911, // you can change this port, see https://redwoodjs.com/docs/project-configuration-dev-test-build#debugger-configuration
13+
"request": "attach",
14+
"skipFiles": [
15+
"<node_internals>/**"
16+
],
17+
"type": "node",
18+
"localRoot": "${workspaceFolder}/node_modules/@redwoodjs/api-server/dist",
19+
"remoteRoot": "${workspaceFolder}/node_modules/@redwoodjs/api-server/dist",
20+
"sourceMaps": true,
21+
"restart": true,
22+
"preLaunchTask": "WaitForDevServer",
23+
},
24+
{
25+
"name": "Launch Web debugger",
26+
"type": "chrome",
27+
"request": "launch",
28+
"url": "http://localhost:8910",
29+
"webRoot": "${workspaceRoot}/web/src",
30+
"preLaunchTask": "WaitForDevServer",
31+
},
32+
{
33+
"command": "yarn redwood test api",
34+
"name": "Test api",
35+
"request": "launch",
36+
"type": "node-terminal"
37+
},
38+
{
39+
"command": "yarn redwood test web",
40+
"name": "Test web",
41+
"request": "launch",
42+
"type": "node-terminal"
43+
},
44+
],
45+
"compounds": [
46+
{
47+
"name": "Start Debug",
48+
"configurations": [
49+
"Run Dev Server",
50+
"Attach API debugger",
51+
"Launch Web debugger"
52+
],
53+
"stopAll": true
54+
}
55+
]
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"editor.tabSize": 2,
3+
"files.trimTrailingWhitespace": true,
4+
"editor.formatOnSave": false,
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": "explicit"
7+
},
8+
"[prisma]": {
9+
"editor.formatOnSave": true
10+
}
11+
}

0 commit comments

Comments
 (0)