Skip to content

Commit

Permalink
docs(examples): converted from e2es
Browse files Browse the repository at this point in the history
  • Loading branch information
theguild-bot authored and github-actions[bot] committed Dec 28, 2024
1 parent c06384c commit adc6ca2
Show file tree
Hide file tree
Showing 144 changed files with 111,383 additions and 2 deletions.
30 changes: 30 additions & 0 deletions examples/apq-subgraphs/.codesandbox/tasks.json
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
}
}
}
}
4 changes: 4 additions & 0 deletions examples/apq-subgraphs/.devcontainer/devcontainer.json
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"
}
20 changes: 20 additions & 0 deletions examples/apq-subgraphs/gateway.config.ts
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`);
},
},
],
});
14 changes: 14 additions & 0 deletions examples/apq-subgraphs/mesh.config.ts
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`,
}),
},
],
});
Loading

0 comments on commit adc6ca2

Please sign in to comment.