-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: enisdenjo <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: theguild-bot <[email protected]>
- Loading branch information
1 parent
121751d
commit 1fbdf70
Showing
172 changed files
with
119,835 additions
and
216 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,95 @@ | ||
name: Examples | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# NOTE: github.event.head_commit.message is not available on pull_request events | ||
head-commit: | ||
name: Inspect head commit | ||
runs-on: ubuntu-latest | ||
outputs: | ||
message: ${{ steps.commit.outputs.message }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{github.event.pull_request.head.sha}} | ||
- name: Inspect | ||
id: commit | ||
run: echo "message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" | ||
|
||
convert: | ||
needs: [head-commit] | ||
if: "${{needs.head-commit.outputs.message != 'docs(examples): converted from e2es'}}" | ||
strategy: | ||
matrix: | ||
e2e: | ||
- extra-fields | ||
- federation-example | ||
- federation-mixed | ||
- file-upload | ||
- apq-subgraphs | ||
- federation-subscriptions-passthrough | ||
- hmac-auth-https | ||
- interface-additional-resolvers | ||
- json-schema-subscriptions | ||
- openapi-additional-resolvers | ||
- openapi-arg-rename | ||
- openapi-javascript-wiki | ||
- openapi-subscriptions | ||
- programmatic-batching | ||
- subscriptions-with-transforms | ||
- type-merging-batching | ||
name: Convert ${{matrix.e2e}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up env | ||
uses: the-guild-org/shared-config/setup@v1 | ||
- name: Convert | ||
run: yarn workspace @internal/examples run start ${{matrix.e2e}} true | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: example-${{matrix.e2e}} | ||
# include all files and folders starting with a dot (.) | ||
include-hidden-files: true | ||
# > If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact. | ||
# https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions | ||
# | ||
# Because of this, we include the root README.md to maintain the paths during artifact downloads | ||
path: | | ||
README.md | ||
examples/${{matrix.e2e}} | ||
!examples/${{matrix.e2e}}/node_modules | ||
commit: | ||
needs: [convert] | ||
name: Commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{secrets.BOT_GITHUB_TOKEN}} | ||
- name: Download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: example-* | ||
merge-multiple: true | ||
- name: Diff | ||
run: git diff --pretty | ||
- name: Commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
file_pattern: examples/ | ||
commit_message: 'docs(examples): converted from e2es' | ||
commit_user_name: theguild-bot | ||
commit_user_email: [email protected] | ||
commit_author: theguild-bot <[email protected]> # dont use the actor as an author |
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 |
---|---|---|
|
@@ -10,3 +10,5 @@ tsconfig.tsbuildinfo | |
sea-prep.blob | ||
hive-gateway | ||
.cache/ | ||
*.pem | ||
/examples/**/*/supergraph.graphql |
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ __generated__ | |
!.changeset/config.json | ||
.wrangler/ | ||
*.Dockerfile | ||
/examples/ |
This file was deleted.
Oops, something went wrong.
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
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
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,2 @@ | ||
> [!CAUTION] | ||
> These examples are auto-generated using the [e2e](/e2e) tests, do NOT modify them directly! |
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,30 @@ | ||
{ | ||
"setupTasks": [ | ||
{ | ||
"name": "Install", | ||
"command": "npm i" | ||
}, | ||
{ | ||
"name": "Start service greetings", | ||
"command": "npm run service:greetings &" | ||
}, | ||
{ | ||
"name": "Wait for service greetings", | ||
"command": "curl --retry-connrefused --retry 10 --retry-delay 3 http://0.0.0.0:4001" | ||
}, | ||
{ | ||
"name": "Compose", | ||
"command": "npm run compose" | ||
} | ||
], | ||
"tasks": { | ||
"gateway": { | ||
"name": "Hive Gateway", | ||
"runAtStart": true, | ||
"command": "npm run gateway", | ||
"preview": { | ||
"port": 4000 | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "Node.js", | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:20" | ||
} |
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,20 @@ | ||
import { defineConfig } from '@graphql-hive/gateway'; | ||
|
||
let fetchCnt = 0; | ||
export const gatewayConfig = defineConfig({ | ||
transportEntries: { | ||
greetings: { | ||
options: { | ||
apq: true, | ||
}, | ||
}, | ||
}, | ||
plugins: () => [ | ||
{ | ||
onFetch({ options }) { | ||
fetchCnt++; | ||
process.stdout.write(`fetch ${fetchCnt} ${options.body}\n`); | ||
}, | ||
}, | ||
], | ||
}); |
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,14 @@ | ||
import { | ||
defineConfig, | ||
loadGraphQLHTTPSubgraph, | ||
} from '@graphql-mesh/compose-cli'; | ||
|
||
export const composeConfig = defineConfig({ | ||
subgraphs: [ | ||
{ | ||
sourceHandler: loadGraphQLHTTPSubgraph('greetings', { | ||
endpoint: `http://localhost:${4001}/graphql`, | ||
}), | ||
}, | ||
], | ||
}); |
Oops, something went wrong.