restql 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +20 -34
- package/dist/cjs/index.js +72 -429
- package/dist/esm/index.js +189 -0
- package/dist/umd/index.js +11890 -20478
- package/dist/umd/index.min.js +7 -1
- package/package.json +47 -59
- package/dist/es/index.js +0 -544
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -4,14 +4,11 @@ RESTful API Resolver for Nested-Linked Resources | 🕸 🕷
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
[](https://codeclimate.com/github/relztic/restql/test_coverage/)
|
|
11
|
-
[](https://github.com/prettier/prettier/)
|
|
12
|
-
|
|
13
|
-
RestQL allows you to dynamically resolve the nested-linked resources of a RESTful API.
|
|
7
|
+
[](https://www.npmjs.com/package/restql/)
|
|
8
|
+

|
|
9
|
+

|
|
14
10
|
|
|
11
|
+
RestQL allows you to dynamically resolve the nested-linked resources of a RESTful API.
|
|
15
12
|
By specifying a set of properties to describe the paths.
|
|
16
13
|
|
|
17
14
|
## Installation
|
|
@@ -19,13 +16,7 @@ By specifying a set of properties to describe the paths.
|
|
|
19
16
|
### npm
|
|
20
17
|
|
|
21
18
|
```sh
|
|
22
|
-
npm install restql
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Yarn
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
yarn add restql
|
|
19
|
+
npm install restql
|
|
29
20
|
```
|
|
30
21
|
|
|
31
22
|
### CDN
|
|
@@ -56,20 +47,18 @@ Self-explanatory.
|
|
|
56
47
|
|
|
57
48
|
**Description**
|
|
58
49
|
|
|
59
|
-
At each level, each property describes a path to the nested resources within the current one.
|
|
60
|
-
|
|
61
|
-
RestQL resolves the sames and call the subsequent resolver against them...
|
|
62
|
-
|
|
50
|
+
At each level, each property describes a path to the nested resources within the current one.
|
|
51
|
+
RestQL resolves the sames and call the subsequent resolver against them.
|
|
63
52
|
Until the base case (`null`) is reached; from which it returns back the merged responses.
|
|
64
53
|
|
|
65
54
|
**Quantifiers**
|
|
66
55
|
|
|
67
56
|
Following is a table of the quantifiers you can use:
|
|
68
57
|
|
|
69
|
-
| Quantifier | Description
|
|
70
|
-
|
|
|
71
|
-
| `[]`
|
|
72
|
-
| `?`
|
|
58
|
+
| Quantifier | Description |
|
|
59
|
+
| ---------- | ------------------------- |
|
|
60
|
+
| `[]` | Collection of properties. |
|
|
61
|
+
| `?` | Optional property. |
|
|
73
62
|
|
|
74
63
|
**e.g.:**
|
|
75
64
|
|
|
@@ -94,7 +83,7 @@ Following is a table of the quantifiers you can use:
|
|
|
94
83
|
|
|
95
84
|
**Description**
|
|
96
85
|
|
|
97
|
-
[`Request Config`](https://github.com/axios/axios
|
|
86
|
+
[`Request Config`](https://github.com/axios/axios/tree/v1.13.6#request-config)
|
|
98
87
|
|
|
99
88
|
**e.g.:**
|
|
100
89
|
|
|
@@ -107,7 +96,6 @@ Following is a table of the quantifiers you can use:
|
|
|
107
96
|
## Usage
|
|
108
97
|
|
|
109
98
|
```js
|
|
110
|
-
// External Packages
|
|
111
99
|
import restql from 'restql'
|
|
112
100
|
|
|
113
101
|
/**
|
|
@@ -136,9 +124,9 @@ const resolver = {
|
|
|
136
124
|
*/
|
|
137
125
|
const options = {
|
|
138
126
|
// ...
|
|
139
|
-
}
|
|
127
|
+
}
|
|
140
128
|
|
|
141
|
-
(async () => {
|
|
129
|
+
;(async () => {
|
|
142
130
|
try {
|
|
143
131
|
const data = await restql(resource, resolver, options)
|
|
144
132
|
|
|
@@ -149,14 +137,12 @@ const options = {
|
|
|
149
137
|
})()
|
|
150
138
|
```
|
|
151
139
|
|
|
152
|
-
[Test RestQL in your browser.](https://npm.runkit.com/restql/)
|
|
153
|
-
|
|
154
140
|
## Roadmap
|
|
155
141
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
142
|
+
- ~~Support for authentication~~
|
|
143
|
+
- ~~Support for optional resolvers~~
|
|
144
|
+
- ~~Improve package bundler~~
|
|
145
|
+
- ~~Ability to cache responses~~
|
|
146
|
+
- Support for recursive resolvers
|
|
161
147
|
|
|
162
|
-
Take
|
|
148
|
+
Take 🎂, Folks! 🌮 🐴 💨
|