Skip to content

Commit 3bd0aff

Browse files
nshntaroragitbook-bot
authored andcommitted
GITBOOK-4: No subject
1 parent e1b5360 commit 3bd0aff

16 files changed

+590
-0
lines changed

docs/.gitbook/assets/Frame 13.png

13 KB
Loading

docs/.gitbook/assets/openapi (1).yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Orbit GraphQL API Documentation
4+
version: 1.0.0
5+
paths:
6+
/graphql:
7+
post:
8+
summary: The path to which you will send your GraphQL requests - this is where the caching happens.
9+
description: |
10+
Configuration:
11+
TOML: handlers_graphql_path
12+
ENV: ORBIT_HANDLERS_GRAPHQL_PATH
13+
requestBody:
14+
required: true
15+
content:
16+
application/json:
17+
schema:
18+
type: object
19+
properties:
20+
operationName:
21+
type: string
22+
query:
23+
type: string
24+
variables:
25+
type: object
26+
responses:
27+
'200':
28+
description: Successful response
29+
content:
30+
application/json:
31+
schema:
32+
type: object
33+
properties:
34+
data:
35+
type: object
36+
errors:
37+
type: object
38+
/flush:
39+
post:
40+
summary: The path to flush all cached data.
41+
description: |
42+
Configuration:
43+
TOML: handlers_flush_all_path
44+
ENV: ORBIT_HANDLERS_FLUSH_ALL_PATH
45+
responses:
46+
'200':
47+
description: Status indicating success or failure of the flush operation.
48+
/flush.type:
49+
post:
50+
summary: The path to flush cached data by GraphQL type.
51+
description: |
52+
Configuration:
53+
TOML: handlers_flush_by_type_path
54+
ENV: ORBIT_HANDLERS_FLUSH_BY_TYPE_PATH
55+
requestBody:
56+
required: true
57+
content:
58+
application/json:
59+
schema:
60+
type: object
61+
properties:
62+
type:
63+
type: string
64+
id:
65+
type: string
66+
responses:
67+
'200':
68+
description: Status indicating success or failure of the flush operation.
69+
/debug:
70+
get:
71+
summary: The path to access debug information. This only works for in_memory cache backend, where it returns the entire cache as a JSON object.
72+
description: |
73+
Configuration:
74+
TOML: handlers_debug_path
75+
ENV: ORBIT_HANDLERS_DEBUG_PATH
76+
responses:
77+
'200':
78+
description: Debug information in JSON format.
79+
content:
80+
application/json:
81+
cacheStore:
82+
type: object
83+
queryStore:
84+
type: object
85+
/health:
86+
get:
87+
summary: The path to check the health status of the service.
88+
description: |
89+
Configuration:
90+
TOML: handlers_health_path
91+
ENV: ORBIT_HANDLERS_HEALTH_PATH
92+
responses:
93+
'200':
94+
description: Health status in JSON format.
95+
content:
96+
application/json:
97+
schema:
98+
type: object

docs/.gitbook/assets/openapi (2).yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Orbit GraphQL API Documentation
4+
version: 1.0.0
5+
paths:
6+
/graphql:
7+
post:
8+
summary: The path to which you will send your GraphQL requests - this is where the caching happens.
9+
description: |
10+
Congiruable using handlers_graphql_path (in config.toml) or ORBIT_HANDLERS_GRAPHQL_PATH (using environment variables)
11+
requestBody:
12+
required: true
13+
content:
14+
application/json:
15+
schema:
16+
type: object
17+
properties:
18+
operationName:
19+
type: string
20+
query:
21+
type: string
22+
variables:
23+
type: object
24+
responses:
25+
'200':
26+
description: Successful response
27+
content:
28+
application/json:
29+
schema:
30+
type: object
31+
properties:
32+
data:
33+
type: object
34+
errors:
35+
type: object
36+
/flush:
37+
post:
38+
summary: The path to flush all cached data.
39+
description: |
40+
Congiruable using handlers_flush_all_path (in config.toml) or ORBIT_HANDLERS_FLUSH_ALL_PATH (using environment variables)
41+
responses:
42+
'200':
43+
description: Status indicating success or failure of the flush operation.
44+
/flush.type:
45+
post:
46+
summary: The path to flush cached data by GraphQL type.
47+
description: |
48+
Configurable using handlers_flush_by_type_path (in config.toml) or ORBIT_HANDLERS_FLUSH_BY_TYPE_PATH (using environment variables)
49+
requestBody:
50+
required: true
51+
content:
52+
application/json:
53+
schema:
54+
type: object
55+
properties:
56+
type:
57+
type: string
58+
id:
59+
type: string
60+
responses:
61+
'200':
62+
description: Status indicating success or failure of the flush operation.
63+
/debug:
64+
get:
65+
summary: The path to access debug information. This only works for in_memory cache backend, where it returns the entire cache as a JSON object.
66+
description: |
67+
Congiruable using handlers_debug_path (in config.toml) or ORBIT_HANDLERS_DEBUG_PATH (using environment variables)
68+
responses:
69+
'200':
70+
description: Debug information in JSON format.
71+
content:
72+
application/json:
73+
cacheStore:
74+
type: object
75+
queryStore:
76+
type: object
77+
/health:
78+
get:
79+
summary: The path to check the health status of the service.
80+
description: |
81+
Congiruable using handlers_health_path (in config.toml) or ORBIT_HANDLERS_HEALTH_PATH (using environment variables)
82+
responses:
83+
'200':
84+
description: Health status in JSON format.
85+
content:
86+
application/json:
87+
schema:
88+
type: object

docs/.gitbook/assets/openapi.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Orbit GraphQL API Documentation
4+
version: 1.0.0
5+
paths:
6+
/graphql:
7+
post:
8+
summary: The path to which you will send your GraphQL requests - this is where the caching happens.
9+
description: |
10+
Configuration:
11+
- _TOML_: `handlers_graphql_path`
12+
- _ENV_: `ORBIT_HANDLERS_GRAPHQL_PATH`
13+
requestBody:
14+
required: true
15+
content:
16+
application/json:
17+
schema:
18+
type: object
19+
properties:
20+
operationName:
21+
type: string
22+
query:
23+
type: string
24+
variables:
25+
type: object
26+
responses:
27+
'200':
28+
description: Successful response
29+
content:
30+
application/json:
31+
schema:
32+
type: object
33+
properties:
34+
data:
35+
type: object
36+
errors:
37+
type: object
38+
/flush-all:
39+
post:
40+
summary: The path to flush all cached data.
41+
description: |
42+
Configuration:
43+
- _TOML_: `handlers_flush_all_path`
44+
- _ENV_: `ORBIT_HANDLERS_FLUSH_ALL_PATH`
45+
responses:
46+
'200':
47+
description: Status indicating success or failure of the flush operation.
48+
/flush-by-type:
49+
post:
50+
summary: The path to flush cached data by GraphQL type.
51+
description: |
52+
Configuration:
53+
- _TOML_: `handlers_flush_by_type_path`
54+
- _ENV_: `ORBIT_HANDLERS_FLUSH_BY_TYPE_PATH`
55+
requestBody:
56+
required: true
57+
content:
58+
application/json:
59+
schema:
60+
type: object
61+
properties:
62+
type:
63+
type: string
64+
id:
65+
type: string
66+
responses:
67+
'200':
68+
description: Status indicating success or failure of the flush operation.
69+
/debug:
70+
get:
71+
summary: The path to access debug information. This only works for `in_memory` cache backend, where it returns the entire cache as a JSON object.
72+
description: |
73+
Configuration:
74+
- _TOML_: `handlers_debug_path`
75+
- _ENV_: `ORBIT_HANDLERS_DEBUG_PATH`
76+
responses:
77+
'200':
78+
description: Debug information in JSON format.
79+
content:
80+
application/json:
81+
cacheStore:
82+
type: object
83+
queryStore:
84+
type: object
85+
/health:
86+
get:
87+
summary: The path to check the health status of the service.
88+
description: |
89+
Configuration:
90+
- _TOML_: `handlers_health_path`
91+
- _ENV_: `ORBIT_HANDLERS_HEALTH_PATH`
92+
responses:
93+
'200':
94+
description: Health status in JSON format.
95+
content:
96+
application/json:
97+
schema:
98+
type: object

docs/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
description: A cache server for your GraphQL API so you're ready for unexpected load
3+
icon: brackets-round
4+
cover: .gitbook/assets/Frame 13.png
5+
coverY: 0
6+
layout:
7+
cover:
8+
visible: true
9+
size: full
10+
title:
11+
visible: true
12+
description:
13+
visible: true
14+
tableOfContents:
15+
visible: true
16+
outline:
17+
visible: true
18+
pagination:
19+
visible: true
20+
---
21+
22+
# Orbit GraphQL
23+
24+
**What?**
25+
26+
1. Deploy it in front of GraphQL API, and it will start caching all requests passing through it.
27+
2. Your cache gets automatically invalidated if anything changes in your application
28+
3. Queries are only sent to origin if there is a cache MISS
29+
30+
**Wait, why is it needed?**
31+
32+
Because all GraphQL requests are on a single endpoint (usually `POST`) and resources are differentiated based on what your request body looks like, we can't use HTTP caching methods for them (say goodbye to etags, 304s, cache-control etc.)
33+
34+
Currently the ecosystem solves for the problem in two ways, client side cache or a server side cache.
35+
36+
Clients like [urql](https://github.com/urql-graphql/urql) can cache your API responses on the client side. Services like [Stellate](https://stellate.co/) act as a cache proxy that does the same thing on the server side.
37+
38+
Orbit GraphQL is an open-source alternative to a tool like Stellate (server side cache for your GraphQL API).
39+
40+
{% hint style="warning" %}
41+
This project is not ready for production traffic yet, but hopefully it will be soon (if you [help](https://github.com/nshntarora/orbitgraphql))
42+
{% endhint %}

docs/SUMMARY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Table of contents
2+
3+
* [Orbit GraphQL](README.md)
4+
* [Quickstart](quickstart.md)
5+
* [How does it work?](how-does-it-work.md)
6+
* [Configuration Options](configuration-options.md)
7+
* [API reference](api-reference/README.md)
8+
* [GraphQL Endpoint](api-reference/graphql-endpoint.md)
9+
* [Cache Purge](api-reference/cache-purge/README.md)
10+
* [Flush Everything](api-reference/cache-purge/flush-everything.md)
11+
* [Flush a Resource](api-reference/cache-purge/flush-a-resource.md)
12+
* [Get Cache Data](api-reference/get-cache-data.md)
13+
* [Healthcheck](api-reference/healthcheck.md)

docs/api-reference/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# API reference
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Cache Purge
2+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Flush a Resource
2+
3+
{% swagger src="../../.gitbook/assets/openapi (2).yml" path="/flush.type" method="post" %}
4+
[openapi (2).yml](<../../.gitbook/assets/openapi (2).yml>)
5+
{% endswagger %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Flush Everything
2+
3+
{% swagger src="../../.gitbook/assets/openapi (2).yml" path="/flush" method="post" %}
4+
[openapi (2).yml](<../../.gitbook/assets/openapi (2).yml>)
5+
{% endswagger %}

docs/api-reference/get-cache-data.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get Cache Data
2+
3+
{% swagger src="../.gitbook/assets/openapi (2).yml" path="/debug" method="get" %}
4+
[openapi (2).yml](<../.gitbook/assets/openapi (2).yml>)
5+
{% endswagger %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# GraphQL Endpoint
2+
3+
{% swagger src="../.gitbook/assets/openapi (2).yml" path="/graphql" method="post" %}
4+
[openapi (2).yml](<../.gitbook/assets/openapi (2).yml>)
5+
{% endswagger %}

docs/api-reference/healthcheck.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Healthcheck
2+
3+
{% swagger src="../.gitbook/assets/openapi (2).yml" path="/health" method="get" %}
4+
[openapi (2).yml](<../.gitbook/assets/openapi (2).yml>)
5+
{% endswagger %}

0 commit comments

Comments
 (0)