Skip to content

Commit 92cfba5

Browse files

19 files changed

+22815
-2
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: GraphQL Mesh Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- "implementations/graphql-mesh/**"
9+
10+
jobs:
11+
compatibility:
12+
uses: ./.github/workflows/test-subgraph.yaml
13+
with:
14+
library: "graphql-mesh"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ router
8585
.bundle
8686

8787
# Python - ignore virtual env
88-
venv
88+
venv
89+
90+
# GraphQL Mesh
91+
.mesh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ The following open-source GraphQL server libraries and hosted subgraphs provide
160160
<tbody>
161161
<tr><td><a href="https://aws.amazon.com/appsync/">AWS AppSync</a></td><td><table><tr><th>_service</th><td>🟢</td></tr><tr><th>@key (single)</th><td>🟢</td></tr><tr><th>@key (multi)</th><td>🟢</td></tr><tr><th>@key (composite)</th><td>🟢</td></tr><tr><th>repeatable @key</th><td>🟢</td></tr><tr><th>@requires</th><td>🟢</td></tr><tr><th>@provides</th><td>🟢</td></tr><tr><th>federated tracing</th><td>🔲</td></tr></table></td><td><table><tr><th>@link</th><td>🟢</td></tr><tr><th>@shareable</th><td>🟢</td></tr><tr><th>@tag</th><td>🟢</td></tr><tr><th>@override</th><td>🟢</td></tr><tr><th>@inaccessible</th><td>🟢</td></tr></table></td></tr>
162162
<tr><td><a href="https://stepzen.com/apollo-stepzen">StepZen</a></td><td><table><tr><th>_service</th><td>🟢</td></tr><tr><th>@key (single)</th><td>🟢</td></tr><tr><th>@key (multi)</th><td>🟢</td></tr><tr><th>@key (composite)</th><td>🔲</td></tr><tr><th>repeatable @key</th><td>🔲</td></tr><tr><th>@requires</th><td>🟢</td></tr><tr><th>@provides</th><td>🟢</td></tr><tr><th>federated tracing</th><td>🔲</td></tr></table></td><td><table><tr><th>@link</th><td>🟢</td></tr><tr><th>@shareable</th><td>🟢</td></tr><tr><th>@tag</th><td>🟢</td></tr><tr><th>@override</th><td>🟢</td></tr><tr><th>@inaccessible</th><td>🟢</td></tr></table></td></tr>
163+
<tr><td><a href="https://www.the-guild.dev/graphql/mesh">GraphQL Mesh</a></td><td><table><tr><th>_service</th><td>🟢</td></tr><tr><th>@key (single)</th><td>🟢</td></tr><tr><th>@key (multi)</th><td>🟢</td></tr><tr><th>@key (composite)</th><td>🟢</td></tr><tr><th>repeatable @key</th><td>🟢</td></tr><tr><th>@requires</th><td>🟢</td></tr><tr><th>@provides</th><td>🟢</td></tr><tr><th>federated tracing</th><td>🟢</td></tr></table></td><td><table><tr><th>@link</th><td>🟢</td></tr><tr><th>@shareable</th><td>🟢</td></tr><tr><th>@tag</th><td>🟢</td></tr><tr><th>@override</th><td>🟢</td></tr><tr><th>@inaccessible</th><td>🟢</td></tr></table></td></tr>
163164
</tbody>
164165
</table>
165166

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
serve:
2+
port: 4001
3+
browser: false
4+
endpoint: /
5+
6+
sources:
7+
- name: GraphQL API
8+
handler:
9+
graphql:
10+
schema: ./src/schema.ts
11+
transforms:
12+
- federation:
13+
types:
14+
- name: Product
15+
config:
16+
key:
17+
- fields: "id"
18+
- fields: "sku package"
19+
- fields: "sku variation { id }"
20+
resolveReference: ./src/resolve-product.ts
21+
fields:
22+
- name: createdBy
23+
config:
24+
provides:
25+
fields: "totalProductsCreated"
26+
- name: notes
27+
config:
28+
tag:
29+
name: "internal"
30+
- name: DeprecatedProduct
31+
config:
32+
key:
33+
- fields: "sku package"
34+
resolveReference: ./src/resolve-deprecated-product.ts
35+
- name: ProductResearch
36+
config:
37+
key:
38+
- fields: "study { caseNumber }"
39+
resolveReference: ./src/resolve-product-research.ts
40+
- name: ProductDimension
41+
config:
42+
shareable: true
43+
fields:
44+
- name: unit
45+
config:
46+
inaccessible: true
47+
- name: User
48+
config:
49+
key:
50+
- fields: email
51+
fields:
52+
- name: averageProductsCreatedPerYear
53+
config:
54+
requires:
55+
fields: "totalProductsCreated yearsOfEmployment"
56+
- name: email
57+
config:
58+
external: true
59+
- name: name
60+
config:
61+
override:
62+
from: "users"
63+
- name: totalProductsCreated
64+
config:
65+
external: true
66+
- name: yearsOfEmployment
67+
config:
68+
external: true
69+
70+
plugins:
71+
- "@graphql-yoga/plugin-apollo-inline-trace": {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:17-alpine
2+
3+
WORKDIR /web
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm install
7+
8+
COPY src ./src
9+
COPY products.graphql tsconfig.json codegen.yaml ./
10+
RUN npm run build
11+
12+
COPY .meshrc.yml ./
13+
EXPOSE 4001
14+
CMD npm run start
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
schema: products.graphql
2+
3+
generates:
4+
./src/resolvers-types.ts:
5+
plugins:
6+
- typescript
7+
- typescript-resolvers
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
products:
3+
# must be relative to the root of the project
4+
build: implementations/graphql-mesh
5+
ports:
6+
- 4001:4001
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fullName: GraphQL Mesh
2+
language: Other Solutions
3+
documentation: https://www.the-guild.dev/graphql/mesh

0 commit comments

Comments
 (0)