Skip to content

Commit 961b8e0

Browse files
authored
Initial commit
0 parents  commit 961b8e0

18 files changed

+9919
-0
lines changed

.apollo/router_config_schema.json

Lines changed: 9622 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
schema
2+
@link(url: "https://specs.apollo.dev/link/v1.0")
3+
@link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION)
4+
@link(url: "https://specs.apollo.dev/tag/v0.3")
5+
{
6+
query: Query
7+
}
8+
9+
enum join__Graph {
10+
PRODUCTS @join__graph(name: "products", url: "http://localhost:4001/")
11+
USERS @join__graph(name: "users", url: "http://localhost:4002/")
12+
}
13+
scalar join__FieldSet
14+
15+
scalar link__Import
16+
17+
enum link__Purpose {
18+
"""
19+
`SECURITY` features provide metadata necessary to securely resolve fields.
20+
"""
21+
SECURITY
22+
23+
"""
24+
`EXECUTION` features provide metadata necessary for operation execution.
25+
"""
26+
EXECUTION
27+
}
28+
29+
directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE
30+
31+
directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
32+
33+
directive @join__graph(name: String!, url: String!) on ENUM_VALUE
34+
35+
directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE
36+
37+
directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
38+
39+
directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION
40+
41+
directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
42+
43+
scalar ErrorRate
44+
@join__type(graph: PRODUCTS)
45+
@join__type(graph: USERS)
46+
47+
directive @synthetics(
48+
"""The synthetic timeout configured for the field."""
49+
timeout: Int
50+
51+
"""The synthetic error rate configured for the field."""
52+
errorRate: ErrorRate
53+
54+
"""Enable or disable synthetics for the field."""
55+
enabled: Boolean = true
56+
) on FIELD
57+
58+
directive @tag(name: String!) repeatable on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA
59+
60+
type Query
61+
@join__type(graph: USERS)
62+
{
63+
"""Information about the current logged-in user."""
64+
me: User @join__field(graph: USERS)
65+
}
66+
67+
type User
68+
@join__type(graph: USERS)
69+
{
70+
name: String
71+
}

.github/workflows/test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
paths:
4+
- Dockerfile
5+
- router.yaml
6+
- .github/workflows/test.yaml
7+
- .github/workflows/supergraph.graphql
8+
jobs:
9+
test:
10+
name: Smoke test Router
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
- name: Build Docker image
16+
run: docker build -t router .
17+
- name: Run Router
18+
run: docker run -d --name router -p 4000:4000 -v ./.github/workflows/supergraph.graphql:/dist/supergraph.graphql router -s supergraph.graphql
19+
- name: Wait for Router to start
20+
run: sleep 5
21+
- name: Test Router
22+
run: |
23+
curl http://localhost:4000 -d '{"query": "query{__typename}"}' -H "Content-Type: application/json"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on:
2+
push:
3+
paths:
4+
- Dockerfile
5+
jobs:
6+
update_schema:
7+
name: Update Router Config JSON Schema
8+
runs-on: ubuntu-latest
9+
continue-on-error: true
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Build Docker image
14+
run: docker build -t router .
15+
- name: Update Config JSON Schema
16+
run: docker run router config schema > .apollo/router_config_schema.json
17+
- name: Check if anything changed
18+
run: git diff --exit-code .apollo/router_config_schema.json
19+
- name: Commit and push changes
20+
if: ${{ failure() }}
21+
run: |
22+
git config --global user.name "github-actions[bot]"
23+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
24+
git add .apollo/router_config_schema.json
25+
git commit -m "Update router config schema"
26+
git push

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

.idea/.gitignore

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/graphql-settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsonSchemas.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"redhat.vscode-yaml"
4+
]
5+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"yaml.schemas": {
3+
".apollo/router_config_schema.json": "router.yaml",
4+
".apollo/supergraph_config_schema.json": "supergraph.yaml"
5+
}
6+
}

0 commit comments

Comments
 (0)