@tinacms/graphql 0.59.9 → 0.60.0
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/CHANGELOG.md +183 -0
- package/dist/ast-builder/index.d.ts +4 -0
- package/dist/builder/index.d.ts +16 -27
- package/dist/database/bridge/index.d.ts +1 -0
- package/dist/database/index.d.ts +6 -1
- package/dist/index.js +338 -674
- package/dist/resolver/filter-utils.d.ts +11 -11
- package/dist/resolver/index.d.ts +34 -89
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
|
12
|
+
*/
|
|
13
13
|
import { ReferenceTypeInner, TinaFieldInner } from '../types';
|
|
14
14
|
import type { FilterCondition } from '@tinacms/datalayer';
|
|
15
15
|
export declare type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceTypeInner) => Promise<{
|
package/dist/resolver/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
10
10
|
See the License for the specific language governing permissions and
|
|
11
11
|
limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import { TinaSchema } from '../schema';
|
|
14
13
|
import { Database } from '../database';
|
|
14
|
+
import { TinaSchema } from '../schema';
|
|
15
15
|
import type { Collectable, ReferenceTypeWithNamespace, TinaCloudCollection } from '../types';
|
|
16
16
|
import { TinaFieldInner } from '../types';
|
|
17
17
|
interface ResolverConfig {
|
|
@@ -60,9 +60,7 @@ export declare class Resolver {
|
|
|
60
60
|
documents: {};
|
|
61
61
|
}>;
|
|
62
62
|
getDocument: (fullPath: unknown) => Promise<{
|
|
63
|
-
|
|
64
|
-
id: string;
|
|
65
|
-
sys: {
|
|
63
|
+
_sys: {
|
|
66
64
|
basename: string;
|
|
67
65
|
filename: string;
|
|
68
66
|
extension: string;
|
|
@@ -72,25 +70,16 @@ export declare class Resolver {
|
|
|
72
70
|
collection: TinaCloudCollection<true>;
|
|
73
71
|
template: string | number;
|
|
74
72
|
};
|
|
75
|
-
|
|
73
|
+
_values: {
|
|
76
74
|
_collection: string;
|
|
77
75
|
_template: string;
|
|
78
76
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
dataJSON: {
|
|
84
|
-
_collection: string;
|
|
85
|
-
_template: string;
|
|
86
|
-
};
|
|
87
|
-
form: {
|
|
88
|
-
label: string;
|
|
89
|
-
name: string;
|
|
90
|
-
fields: unknown[];
|
|
91
|
-
};
|
|
77
|
+
_collection: string;
|
|
78
|
+
_template: string;
|
|
79
|
+
__typename: string;
|
|
80
|
+
id: string;
|
|
92
81
|
}>;
|
|
93
|
-
|
|
82
|
+
deleteDocument: (fullPath: unknown) => Promise<void>;
|
|
94
83
|
buildObjectMutations: (fieldValue: any, field: Collectable) => {
|
|
95
84
|
[key: string]: unknown;
|
|
96
85
|
} | {
|
|
@@ -102,9 +91,7 @@ export declare class Resolver {
|
|
|
102
91
|
args: unknown;
|
|
103
92
|
isAddPendingDocument: boolean;
|
|
104
93
|
}) => Promise<{
|
|
105
|
-
|
|
106
|
-
id: string;
|
|
107
|
-
sys: {
|
|
94
|
+
_sys: {
|
|
108
95
|
basename: string;
|
|
109
96
|
filename: string;
|
|
110
97
|
extension: string;
|
|
@@ -114,23 +101,14 @@ export declare class Resolver {
|
|
|
114
101
|
collection: TinaCloudCollection<true>;
|
|
115
102
|
template: string | number;
|
|
116
103
|
};
|
|
117
|
-
|
|
104
|
+
_values: {
|
|
118
105
|
_collection: string;
|
|
119
106
|
_template: string;
|
|
120
107
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
dataJSON: {
|
|
126
|
-
_collection: string;
|
|
127
|
-
_template: string;
|
|
128
|
-
};
|
|
129
|
-
form: {
|
|
130
|
-
label: string;
|
|
131
|
-
name: string;
|
|
132
|
-
fields: unknown[];
|
|
133
|
-
};
|
|
108
|
+
_collection: string;
|
|
109
|
+
_template: string;
|
|
110
|
+
__typename: string;
|
|
111
|
+
id: string;
|
|
134
112
|
}>;
|
|
135
113
|
updateResolveDocument: ({ collection, realPath, args, isAddPendingDocument, isCollectionSpecific, }: {
|
|
136
114
|
collection: TinaCloudCollection<true>;
|
|
@@ -139,9 +117,7 @@ export declare class Resolver {
|
|
|
139
117
|
isAddPendingDocument: boolean;
|
|
140
118
|
isCollectionSpecific: boolean;
|
|
141
119
|
}) => Promise<{
|
|
142
|
-
|
|
143
|
-
id: string;
|
|
144
|
-
sys: {
|
|
120
|
+
_sys: {
|
|
145
121
|
basename: string;
|
|
146
122
|
filename: string;
|
|
147
123
|
extension: string;
|
|
@@ -151,35 +127,25 @@ export declare class Resolver {
|
|
|
151
127
|
collection: TinaCloudCollection<true>;
|
|
152
128
|
template: string | number;
|
|
153
129
|
};
|
|
154
|
-
|
|
155
|
-
_collection: string;
|
|
156
|
-
_template: string;
|
|
157
|
-
};
|
|
158
|
-
values: {
|
|
130
|
+
_values: {
|
|
159
131
|
_collection: string;
|
|
160
132
|
_template: string;
|
|
161
133
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
form: {
|
|
167
|
-
label: string;
|
|
168
|
-
name: string;
|
|
169
|
-
fields: unknown[];
|
|
170
|
-
};
|
|
134
|
+
_collection: string;
|
|
135
|
+
_template: string;
|
|
136
|
+
__typename: string;
|
|
137
|
+
id: string;
|
|
171
138
|
}>;
|
|
172
|
-
resolveDocument: ({ args, collection: collectionName, isMutation, isCreation, isAddPendingDocument, isCollectionSpecific, }: {
|
|
139
|
+
resolveDocument: ({ args, collection: collectionName, isMutation, isCreation, isDeletion, isAddPendingDocument, isCollectionSpecific, }: {
|
|
173
140
|
args: unknown;
|
|
174
141
|
collection?: string;
|
|
175
142
|
isMutation: boolean;
|
|
176
143
|
isCreation?: boolean;
|
|
144
|
+
isDeletion?: boolean;
|
|
177
145
|
isAddPendingDocument?: boolean;
|
|
178
146
|
isCollectionSpecific?: boolean;
|
|
179
147
|
}) => Promise<{
|
|
180
|
-
|
|
181
|
-
id: string;
|
|
182
|
-
sys: {
|
|
148
|
+
_sys: {
|
|
183
149
|
basename: string;
|
|
184
150
|
filename: string;
|
|
185
151
|
extension: string;
|
|
@@ -189,23 +155,14 @@ export declare class Resolver {
|
|
|
189
155
|
collection: TinaCloudCollection<true>;
|
|
190
156
|
template: string | number;
|
|
191
157
|
};
|
|
192
|
-
|
|
193
|
-
_collection: string;
|
|
194
|
-
_template: string;
|
|
195
|
-
};
|
|
196
|
-
values: {
|
|
197
|
-
_collection: string;
|
|
198
|
-
_template: string;
|
|
199
|
-
};
|
|
200
|
-
dataJSON: {
|
|
158
|
+
_values: {
|
|
201
159
|
_collection: string;
|
|
202
160
|
_template: string;
|
|
203
161
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
};
|
|
162
|
+
_collection: string;
|
|
163
|
+
_template: string;
|
|
164
|
+
__typename: string;
|
|
165
|
+
id: string;
|
|
209
166
|
}>;
|
|
210
167
|
resolveCollectionConnections: ({ ids }: {
|
|
211
168
|
ids: string[];
|
|
@@ -213,9 +170,7 @@ export declare class Resolver {
|
|
|
213
170
|
totalCount: number;
|
|
214
171
|
edges: {
|
|
215
172
|
node: {
|
|
216
|
-
|
|
217
|
-
id: string;
|
|
218
|
-
sys: {
|
|
173
|
+
_sys: {
|
|
219
174
|
basename: string;
|
|
220
175
|
filename: string;
|
|
221
176
|
extension: string;
|
|
@@ -225,23 +180,14 @@ export declare class Resolver {
|
|
|
225
180
|
collection: TinaCloudCollection<true>;
|
|
226
181
|
template: string | number;
|
|
227
182
|
};
|
|
228
|
-
|
|
229
|
-
_collection: string;
|
|
230
|
-
_template: string;
|
|
231
|
-
};
|
|
232
|
-
values: {
|
|
233
|
-
_collection: string;
|
|
234
|
-
_template: string;
|
|
235
|
-
};
|
|
236
|
-
dataJSON: {
|
|
183
|
+
_values: {
|
|
237
184
|
_collection: string;
|
|
238
185
|
_template: string;
|
|
239
186
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
};
|
|
187
|
+
_collection: string;
|
|
188
|
+
_template: string;
|
|
189
|
+
__typename: string;
|
|
190
|
+
id: string;
|
|
245
191
|
};
|
|
246
192
|
}[];
|
|
247
193
|
}>;
|
|
@@ -281,6 +227,5 @@ export declare class Resolver {
|
|
|
281
227
|
* from the corresponding field name in the key
|
|
282
228
|
*/
|
|
283
229
|
private buildParams;
|
|
284
|
-
private resolveField;
|
|
285
230
|
}
|
|
286
231
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@graphql-tools/relay-operation-optimizer": "^6.4.1",
|
|
49
|
-
"@tinacms/datalayer": "0.1.
|
|
49
|
+
"@tinacms/datalayer": "0.1.1",
|
|
50
50
|
"body-parser": "^1.19.0",
|
|
51
51
|
"cors": "^2.8.5",
|
|
52
52
|
"dataloader": "^2.0.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"directory": "packages/tina-graphql"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@tinacms/datalayer": "0.1.
|
|
99
|
+
"@tinacms/datalayer": "0.1.1",
|
|
100
100
|
"@tinacms/scripts": "0.50.7",
|
|
101
101
|
"@types/cors": "^2.8.7",
|
|
102
102
|
"@types/estree": "^0.0.50",
|