Skip to content

Commit d59b666

Browse files
committed
fix #12, endpoint to validate client operations against the latest schema
1 parent 3dbffe6 commit d59b666

22 files changed

+439
-387
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
coverage
22
.nyc_output
3-
dist
3+
dist
4+
insomnia.json

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ State: Experimental
2626
- Stores versioned schemas for all GraphQL-federated services
2727
- Serves schema for GraphQL gateway based on provided services & their versions
2828
- Validates new schema to be compatible with other running services
29+
- Validates that all client operations are supported by your schema
2930
- Produce a diff between your proposed schema and the current registry state
30-
- Lightweight authorization concept with JWT.
31+
- Lightweight authorization concept based on JWT.
3132

3233
[**Read more**](https://principledgraphql.com/integrity#3-track-the-schema-in-a-registry)
3334

docs/api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ POST - `/schema/validate` Validate schema between provided and latest schemas.
107107
</p>
108108
</details>
109109

110+
### Validating client operations
111+
112+
POST - `/document/validate` Confirm that all client operations are supported by the latest schema.
113+
114+
<details>
115+
<summary>Example Request</summary>
116+
<p>
117+
118+
```json
119+
{
120+
"graphName": "my_graph",
121+
"document": "query { hello }"
122+
}
123+
```
124+
125+
</p>
126+
</details>
127+
110128
## Monitoring / Maintanance
111129

112130
### Remove all schemas except the most (N) recent

docs/auth.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ You have to set `JWT_SECRET=secret` to enable jwt. The jwt payload must match th
1010

1111
```jsonc
1212
{
13-
"services": ["foo"] // names of the granted services
14-
}
13+
"client": "my-service", // your unique client name
14+
"services": [] // additional services you have control over.
1515
```
1616
17-
This activates authorization in the `/schema/push` endpoint. Only the client with the valid jwt is be able to register schemas in the name of the services. The client will have access to all available graphs. You can use [jwt.io](https://jwt.io/) to construct a jwt.
17+
This activates authorization in the `/schema/push` endpoint. Only the client with a valid jwt is be able to register schemas in the name of the `services`. The client will have access to all available graphs. You can use [jwt.io](https://jwt.io/) to construct a valid jwt.

0 commit comments

Comments
 (0)