@payloadcms/graphql 3.0.0-alpha.47 → 3.0.0-alpha.49
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/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/resolvers/auth/access.d.ts +1 -1
- package/dist/resolvers/auth/access.d.ts.map +1 -1
- package/dist/resolvers/auth/access.js +1 -1
- package/dist/resolvers/auth/access.js.map +1 -1
- package/dist/resolvers/auth/forgotPassword.d.ts.map +1 -1
- package/dist/resolvers/auth/forgotPassword.js.map +1 -1
- package/dist/resolvers/auth/init.d.ts.map +1 -1
- package/dist/resolvers/auth/init.js.map +1 -1
- package/dist/resolvers/auth/login.d.ts.map +1 -1
- package/dist/resolvers/auth/login.js +3 -3
- package/dist/resolvers/auth/login.js.map +1 -1
- package/dist/resolvers/auth/logout.d.ts.map +1 -1
- package/dist/resolvers/auth/logout.js +1 -1
- package/dist/resolvers/auth/logout.js.map +1 -1
- package/dist/resolvers/auth/me.d.ts.map +1 -1
- package/dist/resolvers/auth/me.js.map +1 -1
- package/dist/resolvers/auth/refresh.d.ts.map +1 -1
- package/dist/resolvers/auth/refresh.js +3 -3
- package/dist/resolvers/auth/refresh.js.map +1 -1
- package/dist/resolvers/auth/resetPassword.d.ts.map +1 -1
- package/dist/resolvers/auth/resetPassword.js +3 -3
- package/dist/resolvers/auth/resetPassword.js.map +1 -1
- package/dist/resolvers/auth/unlock.d.ts.map +1 -1
- package/dist/resolvers/auth/unlock.js.map +1 -1
- package/dist/resolvers/auth/verifyEmail.d.ts.map +1 -1
- package/dist/resolvers/auth/verifyEmail.js.map +1 -1
- package/dist/resolvers/collections/create.d.ts +1 -1
- package/dist/resolvers/collections/create.d.ts.map +1 -1
- package/dist/resolvers/collections/create.js.map +1 -1
- package/dist/resolvers/collections/delete.d.ts.map +1 -1
- package/dist/resolvers/collections/delete.js.map +1 -1
- package/dist/resolvers/collections/docAccess.d.ts +1 -1
- package/dist/resolvers/collections/docAccess.d.ts.map +1 -1
- package/dist/resolvers/collections/docAccess.js +2 -2
- package/dist/resolvers/collections/docAccess.js.map +1 -1
- package/dist/resolvers/collections/duplicate.d.ts +13 -0
- package/dist/resolvers/collections/duplicate.d.ts.map +1 -0
- package/dist/resolvers/collections/duplicate.js +22 -0
- package/dist/resolvers/collections/duplicate.js.map +1 -0
- package/dist/resolvers/collections/find.d.ts.map +1 -1
- package/dist/resolvers/collections/find.js.map +1 -1
- package/dist/resolvers/collections/findByID.d.ts.map +1 -1
- package/dist/resolvers/collections/findByID.js.map +1 -1
- package/dist/resolvers/collections/findVersionByID.d.ts +1 -1
- package/dist/resolvers/collections/findVersionByID.d.ts.map +1 -1
- package/dist/resolvers/collections/findVersionByID.js.map +1 -1
- package/dist/resolvers/collections/findVersions.d.ts +1 -1
- package/dist/resolvers/collections/findVersions.d.ts.map +1 -1
- package/dist/resolvers/collections/findVersions.js.map +1 -1
- package/dist/resolvers/collections/restoreVersion.d.ts.map +1 -1
- package/dist/resolvers/collections/restoreVersion.js.map +1 -1
- package/dist/resolvers/collections/update.d.ts.map +1 -1
- package/dist/resolvers/collections/update.js.map +1 -1
- package/dist/resolvers/globals/docAccess.d.ts +1 -1
- package/dist/resolvers/globals/docAccess.d.ts.map +1 -1
- package/dist/resolvers/globals/docAccess.js.map +1 -1
- package/dist/resolvers/globals/findOne.d.ts.map +1 -1
- package/dist/resolvers/globals/findOne.js.map +1 -1
- package/dist/resolvers/globals/findVersionByID.d.ts.map +1 -1
- package/dist/resolvers/globals/findVersionByID.js.map +1 -1
- package/dist/resolvers/globals/findVersions.d.ts.map +1 -1
- package/dist/resolvers/globals/findVersions.js.map +1 -1
- package/dist/resolvers/globals/restoreVersion.d.ts.map +1 -1
- package/dist/resolvers/globals/restoreVersion.js.map +1 -1
- package/dist/resolvers/globals/update.d.ts +1 -1
- package/dist/resolvers/globals/update.d.ts.map +1 -1
- package/dist/resolvers/globals/update.js.map +1 -1
- package/dist/resolvers/types.d.ts +2 -2
- package/dist/resolvers/types.d.ts.map +1 -1
- package/dist/resolvers/types.js.map +1 -1
- package/dist/schema/buildFallbackLocaleInputType.d.ts +1 -1
- package/dist/schema/buildFallbackLocaleInputType.d.ts.map +1 -1
- package/dist/schema/buildFallbackLocaleInputType.js.map +1 -1
- package/dist/schema/buildLocaleInputType.d.ts +1 -1
- package/dist/schema/buildLocaleInputType.d.ts.map +1 -1
- package/dist/schema/buildLocaleInputType.js.map +1 -1
- package/dist/schema/buildMutationInputType.d.ts +6 -6
- package/dist/schema/buildMutationInputType.d.ts.map +1 -1
- package/dist/schema/buildMutationInputType.js +9 -9
- package/dist/schema/buildMutationInputType.js.map +1 -1
- package/dist/schema/buildObjectType.d.ts +5 -5
- package/dist/schema/buildObjectType.d.ts.map +1 -1
- package/dist/schema/buildObjectType.js +15 -15
- package/dist/schema/buildObjectType.js.map +1 -1
- package/dist/schema/buildPoliciesType.d.ts +1 -1
- package/dist/schema/buildPoliciesType.d.ts.map +1 -1
- package/dist/schema/buildPoliciesType.js +4 -4
- package/dist/schema/buildPoliciesType.js.map +1 -1
- package/dist/schema/buildWhereInputType.d.ts +1 -1
- package/dist/schema/buildWhereInputType.d.ts.map +1 -1
- package/dist/schema/buildWhereInputType.js +1 -1
- package/dist/schema/buildWhereInputType.js.map +1 -1
- package/dist/schema/fieldToWhereInputSchemaMap.js.map +1 -1
- package/dist/schema/initCollections.d.ts.map +1 -1
- package/dist/schema/initCollections.js +99 -89
- package/dist/schema/initCollections.js.map +1 -1
- package/dist/schema/initGlobals.d.ts.map +1 -1
- package/dist/schema/initGlobals.js +33 -32
- package/dist/schema/initGlobals.js.map +1 -1
- package/dist/schema/recursivelyBuildNestedPaths.d.ts.map +1 -1
- package/dist/schema/recursivelyBuildNestedPaths.js +2 -2
- package/dist/schema/recursivelyBuildNestedPaths.js.map +1 -1
- package/dist/schema/withNullableType.d.ts.map +1 -1
- package/dist/schema/withNullableType.js.map +1 -1
- package/dist/schema/withOperators.d.ts +1 -1
- package/dist/schema/withOperators.d.ts.map +1 -1
- package/dist/schema/withOperators.js +3 -3
- package/dist/schema/withOperators.js.map +1 -1
- package/dist/utilities/wrapCustomResolver.d.ts.map +1 -1
- package/dist/utilities/wrapCustomResolver.js.map +1 -1
- package/package.json +4 -6
- package/src/index.ts +19 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ import { GraphQLBoolean, GraphQLInt, GraphQLNonNull, GraphQLObjectType, GraphQLString } from 'graphql';
|
|
2
|
-
import { flattenTopLevelFields, formatNames, toWords } from 'payload/utilities';
|
|
3
2
|
import { fieldAffectsData } from 'payload/types';
|
|
3
|
+
import { flattenTopLevelFields, formatNames, toWords } from 'payload/utilities';
|
|
4
4
|
import { buildVersionCollectionFields } from 'payload/versions';
|
|
5
5
|
import forgotPassword from '../resolvers/auth/forgotPassword.js';
|
|
6
6
|
import init from '../resolvers/auth/init.js';
|
|
@@ -11,21 +11,22 @@ import refresh from '../resolvers/auth/refresh.js';
|
|
|
11
11
|
import resetPassword from '../resolvers/auth/resetPassword.js';
|
|
12
12
|
import unlock from '../resolvers/auth/unlock.js';
|
|
13
13
|
import verifyEmail from '../resolvers/auth/verifyEmail.js';
|
|
14
|
-
import { buildMutationInputType, getCollectionIDType } from './buildMutationInputType.js';
|
|
15
|
-
import buildObjectType from './buildObjectType.js';
|
|
16
|
-
import buildPaginatedListType from './buildPaginatedListType.js';
|
|
17
|
-
import { buildPolicyType } from './buildPoliciesType.js';
|
|
18
|
-
import buildWhereInputType from './buildWhereInputType.js';
|
|
19
|
-
import formatName from '../utilities/formatName.js';
|
|
20
14
|
import createResolver from '../resolvers/collections/create.js';
|
|
21
15
|
import getDeleteResolver from '../resolvers/collections/delete.js';
|
|
22
16
|
import { docAccessResolver } from '../resolvers/collections/docAccess.js';
|
|
17
|
+
import duplicateResolver from '../resolvers/collections/duplicate.js';
|
|
23
18
|
import findResolver from '../resolvers/collections/find.js';
|
|
24
19
|
import findByIDResolver from '../resolvers/collections/findByID.js';
|
|
25
20
|
import findVersionByIDResolver from '../resolvers/collections/findVersionByID.js';
|
|
26
21
|
import findVersionsResolver from '../resolvers/collections/findVersions.js';
|
|
27
22
|
import restoreVersionResolver from '../resolvers/collections/restoreVersion.js';
|
|
28
23
|
import updateResolver from '../resolvers/collections/update.js';
|
|
24
|
+
import formatName from '../utilities/formatName.js';
|
|
25
|
+
import { buildMutationInputType, getCollectionIDType } from './buildMutationInputType.js';
|
|
26
|
+
import buildObjectType from './buildObjectType.js';
|
|
27
|
+
import buildPaginatedListType from './buildPaginatedListType.js';
|
|
28
|
+
import { buildPolicyType } from './buildPoliciesType.js';
|
|
29
|
+
import buildWhereInputType from './buildWhereInputType.js';
|
|
29
30
|
function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
30
31
|
Object.keys(graphqlResult.collections).forEach((slug)=>{
|
|
31
32
|
const collection = graphqlResult.collections[slug];
|
|
@@ -71,11 +72,11 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
71
72
|
collection.graphQL.type = buildObjectType({
|
|
72
73
|
name: singularName,
|
|
73
74
|
baseFields,
|
|
75
|
+
config,
|
|
74
76
|
fields,
|
|
75
77
|
forceNullable: forceNullableObjectType,
|
|
76
|
-
parentName: singularName,
|
|
77
78
|
graphqlResult,
|
|
78
|
-
|
|
79
|
+
parentName: singularName
|
|
79
80
|
});
|
|
80
81
|
collection.graphQL.paginatedType = buildPaginatedListType(pluralName, collection.graphQL.type);
|
|
81
82
|
collection.graphQL.whereInputType = buildWhereInputType({
|
|
@@ -86,33 +87,34 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
86
87
|
if (collectionConfig.auth && !collectionConfig.auth.disableLocalStrategy) {
|
|
87
88
|
fields.push({
|
|
88
89
|
name: 'password',
|
|
90
|
+
type: 'text',
|
|
89
91
|
label: 'Password',
|
|
90
|
-
required: true
|
|
91
|
-
type: 'text'
|
|
92
|
+
required: true
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
const createMutationInputType = buildMutationInputType({
|
|
95
96
|
name: singularName,
|
|
97
|
+
config,
|
|
96
98
|
fields,
|
|
97
|
-
parentName: singularName,
|
|
98
99
|
graphqlResult,
|
|
99
|
-
|
|
100
|
+
parentName: singularName
|
|
100
101
|
});
|
|
101
102
|
if (createMutationInputType) {
|
|
102
103
|
collection.graphQL.mutationInputType = new GraphQLNonNull(createMutationInputType);
|
|
103
104
|
}
|
|
104
105
|
const updateMutationInputType = buildMutationInputType({
|
|
105
106
|
name: `${singularName}Update`,
|
|
107
|
+
config,
|
|
106
108
|
fields: fields.filter((field)=>!(fieldAffectsData(field) && field.name === 'id')),
|
|
107
|
-
parentName: `${singularName}Update`,
|
|
108
109
|
forceNullable: true,
|
|
109
110
|
graphqlResult,
|
|
110
|
-
|
|
111
|
+
parentName: `${singularName}Update`
|
|
111
112
|
});
|
|
112
113
|
if (updateMutationInputType) {
|
|
113
114
|
collection.graphQL.updateMutationInputType = new GraphQLNonNull(updateMutationInputType);
|
|
114
115
|
}
|
|
115
116
|
graphqlResult.Query.fields[singularName] = {
|
|
117
|
+
type: collection.graphQL.type,
|
|
116
118
|
args: {
|
|
117
119
|
id: {
|
|
118
120
|
type: new GraphQLNonNull(idType)
|
|
@@ -129,10 +131,10 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
129
131
|
}
|
|
130
132
|
} : {}
|
|
131
133
|
},
|
|
132
|
-
resolve: findByIDResolver(collection)
|
|
133
|
-
type: collection.graphQL.type
|
|
134
|
+
resolve: findByIDResolver(collection)
|
|
134
135
|
};
|
|
135
136
|
graphqlResult.Query.fields[pluralName] = {
|
|
137
|
+
type: buildPaginatedListType(pluralName, collection.graphQL.type),
|
|
136
138
|
args: {
|
|
137
139
|
draft: {
|
|
138
140
|
type: GraphQLBoolean
|
|
@@ -158,24 +160,24 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
158
160
|
type: GraphQLString
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
|
-
resolve: findResolver(collection)
|
|
162
|
-
type: buildPaginatedListType(pluralName, collection.graphQL.type)
|
|
163
|
+
resolve: findResolver(collection)
|
|
163
164
|
};
|
|
164
165
|
graphqlResult.Query.fields[`docAccess${singularName}`] = {
|
|
166
|
+
type: buildPolicyType({
|
|
167
|
+
type: 'collection',
|
|
168
|
+
entity: collectionConfig,
|
|
169
|
+
scope: 'docAccess',
|
|
170
|
+
typeSuffix: 'DocAccess'
|
|
171
|
+
}),
|
|
165
172
|
args: {
|
|
166
173
|
id: {
|
|
167
174
|
type: new GraphQLNonNull(idType)
|
|
168
175
|
}
|
|
169
176
|
},
|
|
170
|
-
resolve: docAccessResolver(collection)
|
|
171
|
-
type: buildPolicyType({
|
|
172
|
-
entity: collectionConfig,
|
|
173
|
-
scope: 'docAccess',
|
|
174
|
-
type: 'collection',
|
|
175
|
-
typeSuffix: 'DocAccess'
|
|
176
|
-
})
|
|
177
|
+
resolve: docAccessResolver(collection)
|
|
177
178
|
};
|
|
178
179
|
graphqlResult.Mutation.fields[`create${singularName}`] = {
|
|
180
|
+
type: collection.graphQL.type,
|
|
179
181
|
args: {
|
|
180
182
|
...createMutationInputType ? {
|
|
181
183
|
data: {
|
|
@@ -191,10 +193,10 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
191
193
|
}
|
|
192
194
|
} : {}
|
|
193
195
|
},
|
|
194
|
-
resolve: createResolver(collection)
|
|
195
|
-
type: collection.graphQL.type
|
|
196
|
+
resolve: createResolver(collection)
|
|
196
197
|
};
|
|
197
198
|
graphqlResult.Mutation.fields[`update${singularName}`] = {
|
|
199
|
+
type: collection.graphQL.type,
|
|
198
200
|
args: {
|
|
199
201
|
id: {
|
|
200
202
|
type: new GraphQLNonNull(idType)
|
|
@@ -216,17 +218,25 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
216
218
|
}
|
|
217
219
|
} : {}
|
|
218
220
|
},
|
|
219
|
-
resolve: updateResolver(collection)
|
|
220
|
-
type: collection.graphQL.type
|
|
221
|
+
resolve: updateResolver(collection)
|
|
221
222
|
};
|
|
222
223
|
graphqlResult.Mutation.fields[`delete${singularName}`] = {
|
|
224
|
+
type: collection.graphQL.type,
|
|
223
225
|
args: {
|
|
224
226
|
id: {
|
|
225
227
|
type: new GraphQLNonNull(idType)
|
|
226
228
|
}
|
|
227
229
|
},
|
|
228
|
-
resolve: getDeleteResolver(collection)
|
|
229
|
-
|
|
230
|
+
resolve: getDeleteResolver(collection)
|
|
231
|
+
};
|
|
232
|
+
graphqlResult.Mutation.fields[`duplicate${singularName}`] = {
|
|
233
|
+
type: collection.graphQL.type,
|
|
234
|
+
args: {
|
|
235
|
+
id: {
|
|
236
|
+
type: new GraphQLNonNull(idType)
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
resolve: duplicateResolver(collection)
|
|
230
240
|
};
|
|
231
241
|
if (collectionConfig.versions) {
|
|
232
242
|
const versionIDType = config.db.defaultIDType === 'text' ? GraphQLString : GraphQLInt;
|
|
@@ -238,24 +248,25 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
238
248
|
},
|
|
239
249
|
{
|
|
240
250
|
name: 'createdAt',
|
|
241
|
-
|
|
242
|
-
|
|
251
|
+
type: 'date',
|
|
252
|
+
label: 'Created At'
|
|
243
253
|
},
|
|
244
254
|
{
|
|
245
255
|
name: 'updatedAt',
|
|
246
|
-
|
|
247
|
-
|
|
256
|
+
type: 'date',
|
|
257
|
+
label: 'Updated At'
|
|
248
258
|
}
|
|
249
259
|
];
|
|
250
260
|
collection.graphQL.versionType = buildObjectType({
|
|
251
261
|
name: `${singularName}Version`,
|
|
262
|
+
config,
|
|
252
263
|
fields: versionCollectionFields,
|
|
253
264
|
forceNullable: forceNullableObjectType,
|
|
254
|
-
parentName: `${singularName}Version`,
|
|
255
265
|
graphqlResult,
|
|
256
|
-
|
|
266
|
+
parentName: `${singularName}Version`
|
|
257
267
|
});
|
|
258
268
|
graphqlResult.Query.fields[`version${formatName(singularName)}`] = {
|
|
269
|
+
type: collection.graphQL.versionType,
|
|
259
270
|
args: {
|
|
260
271
|
id: {
|
|
261
272
|
type: versionIDType
|
|
@@ -269,10 +280,10 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
269
280
|
}
|
|
270
281
|
} : {}
|
|
271
282
|
},
|
|
272
|
-
resolve: findVersionByIDResolver(collection)
|
|
273
|
-
type: collection.graphQL.versionType
|
|
283
|
+
resolve: findVersionByIDResolver(collection)
|
|
274
284
|
};
|
|
275
285
|
graphqlResult.Query.fields[`versions${pluralName}`] = {
|
|
286
|
+
type: buildPaginatedListType(`versions${formatName(pluralName)}`, collection.graphQL.versionType),
|
|
276
287
|
args: {
|
|
277
288
|
where: {
|
|
278
289
|
type: buildWhereInputType({
|
|
@@ -299,44 +310,42 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
299
310
|
type: GraphQLString
|
|
300
311
|
}
|
|
301
312
|
},
|
|
302
|
-
resolve: findVersionsResolver(collection)
|
|
303
|
-
type: buildPaginatedListType(`versions${formatName(pluralName)}`, collection.graphQL.versionType)
|
|
313
|
+
resolve: findVersionsResolver(collection)
|
|
304
314
|
};
|
|
305
315
|
graphqlResult.Mutation.fields[`restoreVersion${formatName(singularName)}`] = {
|
|
316
|
+
type: collection.graphQL.type,
|
|
306
317
|
args: {
|
|
307
318
|
id: {
|
|
308
319
|
type: versionIDType
|
|
309
320
|
}
|
|
310
321
|
},
|
|
311
|
-
resolve: restoreVersionResolver(collection)
|
|
312
|
-
type: collection.graphQL.type
|
|
322
|
+
resolve: restoreVersionResolver(collection)
|
|
313
323
|
};
|
|
314
324
|
}
|
|
315
325
|
if (collectionConfig.auth) {
|
|
316
326
|
const authFields = collectionConfig.auth.disableLocalStrategy ? [] : [
|
|
317
327
|
{
|
|
318
328
|
name: 'email',
|
|
319
|
-
|
|
320
|
-
|
|
329
|
+
type: 'email',
|
|
330
|
+
required: true
|
|
321
331
|
}
|
|
322
332
|
];
|
|
323
333
|
collection.graphQL.JWT = buildObjectType({
|
|
324
334
|
name: formatName(`${slug}JWT`),
|
|
335
|
+
config,
|
|
325
336
|
fields: [
|
|
326
337
|
...collectionConfig.fields.filter((field)=>fieldAffectsData(field) && field.saveToJWT),
|
|
327
338
|
...authFields,
|
|
328
339
|
{
|
|
329
340
|
name: 'collection',
|
|
330
|
-
|
|
331
|
-
|
|
341
|
+
type: 'text',
|
|
342
|
+
required: true
|
|
332
343
|
}
|
|
333
344
|
],
|
|
334
|
-
parentName: formatName(`${slug}JWT`),
|
|
335
345
|
graphqlResult,
|
|
336
|
-
|
|
346
|
+
parentName: formatName(`${slug}JWT`)
|
|
337
347
|
});
|
|
338
348
|
graphqlResult.Query.fields[`me${singularName}`] = {
|
|
339
|
-
resolve: me(collection),
|
|
340
349
|
type: new GraphQLObjectType({
|
|
341
350
|
name: formatName(`${slug}Me`),
|
|
342
351
|
fields: {
|
|
@@ -353,19 +362,14 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
353
362
|
type: collection.graphQL.type
|
|
354
363
|
}
|
|
355
364
|
}
|
|
356
|
-
})
|
|
365
|
+
}),
|
|
366
|
+
resolve: me(collection)
|
|
357
367
|
};
|
|
358
368
|
graphqlResult.Query.fields[`initialized${singularName}`] = {
|
|
359
|
-
|
|
360
|
-
|
|
369
|
+
type: GraphQLBoolean,
|
|
370
|
+
resolve: init(collection.config.slug)
|
|
361
371
|
};
|
|
362
372
|
graphqlResult.Mutation.fields[`refreshToken${singularName}`] = {
|
|
363
|
-
args: {
|
|
364
|
-
token: {
|
|
365
|
-
type: GraphQLString
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
resolve: refresh(collection),
|
|
369
373
|
type: new GraphQLObjectType({
|
|
370
374
|
name: formatName(`${slug}Refreshed${singularName}`),
|
|
371
375
|
fields: {
|
|
@@ -379,34 +383,31 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
379
383
|
type: collection.graphQL.JWT
|
|
380
384
|
}
|
|
381
385
|
}
|
|
382
|
-
})
|
|
386
|
+
}),
|
|
387
|
+
args: {
|
|
388
|
+
token: {
|
|
389
|
+
type: GraphQLString
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
resolve: refresh(collection)
|
|
383
393
|
};
|
|
384
394
|
graphqlResult.Mutation.fields[`logout${singularName}`] = {
|
|
385
|
-
|
|
386
|
-
|
|
395
|
+
type: GraphQLString,
|
|
396
|
+
resolve: logout(collection)
|
|
387
397
|
};
|
|
388
398
|
if (!collectionConfig.auth.disableLocalStrategy) {
|
|
389
399
|
if (collectionConfig.auth.maxLoginAttempts > 0) {
|
|
390
400
|
graphqlResult.Mutation.fields[`unlock${singularName}`] = {
|
|
401
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
391
402
|
args: {
|
|
392
403
|
email: {
|
|
393
404
|
type: new GraphQLNonNull(GraphQLString)
|
|
394
405
|
}
|
|
395
406
|
},
|
|
396
|
-
resolve: unlock(collection)
|
|
397
|
-
type: new GraphQLNonNull(GraphQLBoolean)
|
|
407
|
+
resolve: unlock(collection)
|
|
398
408
|
};
|
|
399
409
|
}
|
|
400
410
|
graphqlResult.Mutation.fields[`login${singularName}`] = {
|
|
401
|
-
args: {
|
|
402
|
-
email: {
|
|
403
|
-
type: GraphQLString
|
|
404
|
-
},
|
|
405
|
-
password: {
|
|
406
|
-
type: GraphQLString
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
resolve: login(collection),
|
|
410
411
|
type: new GraphQLObjectType({
|
|
411
412
|
name: formatName(`${slug}LoginResult`),
|
|
412
413
|
fields: {
|
|
@@ -420,9 +421,19 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
420
421
|
type: collection.graphQL.type
|
|
421
422
|
}
|
|
422
423
|
}
|
|
423
|
-
})
|
|
424
|
+
}),
|
|
425
|
+
args: {
|
|
426
|
+
email: {
|
|
427
|
+
type: GraphQLString
|
|
428
|
+
},
|
|
429
|
+
password: {
|
|
430
|
+
type: GraphQLString
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
resolve: login(collection)
|
|
424
434
|
};
|
|
425
435
|
graphqlResult.Mutation.fields[`forgotPassword${singularName}`] = {
|
|
436
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
426
437
|
args: {
|
|
427
438
|
disableEmail: {
|
|
428
439
|
type: GraphQLBoolean
|
|
@@ -434,19 +445,9 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
434
445
|
type: GraphQLInt
|
|
435
446
|
}
|
|
436
447
|
},
|
|
437
|
-
resolve: forgotPassword(collection)
|
|
438
|
-
type: new GraphQLNonNull(GraphQLBoolean)
|
|
448
|
+
resolve: forgotPassword(collection)
|
|
439
449
|
};
|
|
440
450
|
graphqlResult.Mutation.fields[`resetPassword${singularName}`] = {
|
|
441
|
-
args: {
|
|
442
|
-
password: {
|
|
443
|
-
type: GraphQLString
|
|
444
|
-
},
|
|
445
|
-
token: {
|
|
446
|
-
type: GraphQLString
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
resolve: resetPassword(collection),
|
|
450
451
|
type: new GraphQLObjectType({
|
|
451
452
|
name: formatName(`${slug}ResetPassword`),
|
|
452
453
|
fields: {
|
|
@@ -457,16 +458,25 @@ function initCollectionsGraphQL({ config, graphqlResult }) {
|
|
|
457
458
|
type: collection.graphQL.type
|
|
458
459
|
}
|
|
459
460
|
}
|
|
460
|
-
})
|
|
461
|
+
}),
|
|
462
|
+
args: {
|
|
463
|
+
password: {
|
|
464
|
+
type: GraphQLString
|
|
465
|
+
},
|
|
466
|
+
token: {
|
|
467
|
+
type: GraphQLString
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
resolve: resetPassword(collection)
|
|
461
471
|
};
|
|
462
472
|
graphqlResult.Mutation.fields[`verifyEmail${singularName}`] = {
|
|
473
|
+
type: GraphQLBoolean,
|
|
463
474
|
args: {
|
|
464
475
|
token: {
|
|
465
476
|
type: GraphQLString
|
|
466
477
|
}
|
|
467
478
|
},
|
|
468
|
-
resolve: verifyEmail(collection)
|
|
469
|
-
type: GraphQLBoolean
|
|
479
|
+
resolve: verifyEmail(collection)
|
|
470
480
|
};
|
|
471
481
|
}
|
|
472
482
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/initCollections.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport {\n GraphQLBoolean,\n GraphQLInt,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLString,\n} from 'graphql'\n\nimport { flattenTopLevelFields, formatNames, toWords } from 'payload/utilities'\nimport { fieldAffectsData } from 'payload/types'\nimport { buildVersionCollectionFields } from 'payload/versions'\nimport type { GraphQLInfo } from 'payload/config'\nimport type { Field, Collection, SanitizedCollectionConfig, SanitizedConfig } from 'payload/types'\n\nimport type { ObjectTypeConfig } from './buildObjectType.js'\nimport forgotPassword from '../resolvers/auth/forgotPassword.js'\nimport init from '../resolvers/auth/init.js'\nimport login from '../resolvers/auth/login.js'\nimport logout from '../resolvers/auth/logout.js'\nimport me from '../resolvers/auth/me.js'\nimport refresh from '../resolvers/auth/refresh.js'\nimport resetPassword from '../resolvers/auth/resetPassword.js'\nimport unlock from '../resolvers/auth/unlock.js'\nimport verifyEmail from '../resolvers/auth/verifyEmail.js'\nimport { buildMutationInputType, getCollectionIDType } from './buildMutationInputType.js'\nimport buildObjectType from './buildObjectType.js'\nimport buildPaginatedListType from './buildPaginatedListType.js'\nimport { buildPolicyType } from './buildPoliciesType.js'\nimport buildWhereInputType from './buildWhereInputType.js'\nimport formatName from '../utilities/formatName.js'\nimport createResolver from '../resolvers/collections/create.js'\nimport getDeleteResolver from '../resolvers/collections/delete.js'\nimport { docAccessResolver } from '../resolvers/collections/docAccess.js'\nimport findResolver from '../resolvers/collections/find.js'\nimport findByIDResolver from '../resolvers/collections/findByID.js'\nimport findVersionByIDResolver from '../resolvers/collections/findVersionByID.js'\nimport findVersionsResolver from '../resolvers/collections/findVersions.js'\nimport restoreVersionResolver from '../resolvers/collections/restoreVersion.js'\nimport updateResolver from '../resolvers/collections/update.js'\n\ntype InitCollectionsGraphQLArgs = {\n config: SanitizedConfig\n graphqlResult: GraphQLInfo\n}\nfunction initCollectionsGraphQL({ config, graphqlResult }: InitCollectionsGraphQLArgs): void {\n Object.keys(graphqlResult.collections).forEach((slug) => {\n const collection: Collection = graphqlResult.collections[slug]\n const {\n config: collectionConfig,\n config: { fields, graphQL = {} as SanitizedCollectionConfig['graphQL'], versions },\n } = collection\n\n if (!graphQL) return\n\n let singularName\n let pluralName\n const fromSlug = formatNames(collection.config.slug)\n if (graphQL.singularName) {\n singularName = toWords(graphQL.singularName, true)\n } else {\n singularName = fromSlug.singular\n }\n if (graphQL.pluralName) {\n pluralName = toWords(graphQL.pluralName, true)\n } else {\n pluralName = fromSlug.plural\n }\n\n // For collections named 'Media' or similar,\n // there is a possibility that the singular name\n // will equal the plural name. Append `all` to the beginning\n // of potential conflicts\n if (singularName === pluralName) {\n pluralName = `all${singularName}`\n }\n\n collection.graphQL = {} as Collection['graphQL']\n\n const hasIDField =\n flattenTopLevelFields(fields).findIndex(\n (field) => fieldAffectsData(field) && field.name === 'id',\n ) > -1\n\n const idType = getCollectionIDType(config.db.defaultIDType, collectionConfig)\n\n const baseFields: ObjectTypeConfig = {}\n\n const whereInputFields = [...fields]\n\n if (!hasIDField) {\n baseFields.id = { type: idType }\n whereInputFields.push({\n name: 'id',\n type: config.db.defaultIDType as 'text',\n })\n }\n\n const forceNullableObjectType = Boolean(versions?.drafts)\n\n collection.graphQL.type = buildObjectType({\n name: singularName,\n baseFields,\n fields,\n forceNullable: forceNullableObjectType,\n parentName: singularName,\n graphqlResult,\n config,\n })\n\n collection.graphQL.paginatedType = buildPaginatedListType(pluralName, collection.graphQL.type)\n\n collection.graphQL.whereInputType = buildWhereInputType({\n name: singularName,\n fields: whereInputFields,\n parentName: singularName,\n })\n\n if (collectionConfig.auth && !collectionConfig.auth.disableLocalStrategy) {\n fields.push({\n name: 'password',\n label: 'Password',\n required: true,\n type: 'text',\n })\n }\n\n const createMutationInputType = buildMutationInputType({\n name: singularName,\n fields,\n parentName: singularName,\n graphqlResult,\n config,\n })\n if (createMutationInputType) {\n collection.graphQL.mutationInputType = new GraphQLNonNull(createMutationInputType)\n }\n\n const updateMutationInputType = buildMutationInputType({\n name: `${singularName}Update`,\n fields: fields.filter((field) => !(fieldAffectsData(field) && field.name === 'id')),\n parentName: `${singularName}Update`,\n forceNullable: true,\n graphqlResult,\n config,\n })\n if (updateMutationInputType) {\n collection.graphQL.updateMutationInputType = new GraphQLNonNull(updateMutationInputType)\n }\n\n graphqlResult.Query.fields[singularName] = {\n args: {\n id: { type: new GraphQLNonNull(idType) },\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: findByIDResolver(collection),\n type: collection.graphQL.type,\n }\n\n graphqlResult.Query.fields[pluralName] = {\n args: {\n draft: { type: GraphQLBoolean },\n where: { type: collection.graphQL.whereInputType },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n limit: { type: GraphQLInt },\n page: { type: GraphQLInt },\n sort: { type: GraphQLString },\n },\n resolve: findResolver(collection),\n type: buildPaginatedListType(pluralName, collection.graphQL.type),\n }\n\n graphqlResult.Query.fields[`docAccess${singularName}`] = {\n args: {\n id: { type: new GraphQLNonNull(idType) },\n },\n resolve: docAccessResolver(collection),\n type: buildPolicyType({\n entity: collectionConfig,\n scope: 'docAccess',\n type: 'collection',\n typeSuffix: 'DocAccess',\n }),\n }\n\n graphqlResult.Mutation.fields[`create${singularName}`] = {\n args: {\n ...(createMutationInputType\n ? { data: { type: collection.graphQL.mutationInputType } }\n : {}),\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: createResolver(collection),\n type: collection.graphQL.type,\n }\n\n graphqlResult.Mutation.fields[`update${singularName}`] = {\n args: {\n id: { type: new GraphQLNonNull(idType) },\n autosave: { type: GraphQLBoolean },\n ...(updateMutationInputType\n ? { data: { type: collection.graphQL.updateMutationInputType } }\n : {}),\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: updateResolver(collection),\n type: collection.graphQL.type,\n }\n\n graphqlResult.Mutation.fields[`delete${singularName}`] = {\n args: {\n id: { type: new GraphQLNonNull(idType) },\n },\n resolve: getDeleteResolver(collection),\n type: collection.graphQL.type,\n }\n\n if (collectionConfig.versions) {\n const versionIDType = config.db.defaultIDType === 'text' ? GraphQLString : GraphQLInt\n const versionCollectionFields: Field[] = [\n ...buildVersionCollectionFields(collectionConfig),\n {\n name: 'id',\n type: config.db.defaultIDType as 'text',\n },\n {\n name: 'createdAt',\n label: 'Created At',\n type: 'date',\n },\n {\n name: 'updatedAt',\n label: 'Updated At',\n type: 'date',\n },\n ]\n\n collection.graphQL.versionType = buildObjectType({\n name: `${singularName}Version`,\n fields: versionCollectionFields,\n forceNullable: forceNullableObjectType,\n parentName: `${singularName}Version`,\n graphqlResult,\n config,\n })\n\n graphqlResult.Query.fields[`version${formatName(singularName)}`] = {\n args: {\n id: { type: versionIDType },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: findVersionByIDResolver(collection),\n type: collection.graphQL.versionType,\n }\n graphqlResult.Query.fields[`versions${pluralName}`] = {\n args: {\n where: {\n type: buildWhereInputType({\n name: `versions${singularName}`,\n fields: versionCollectionFields,\n parentName: `versions${singularName}`,\n }),\n },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n limit: { type: GraphQLInt },\n page: { type: GraphQLInt },\n sort: { type: GraphQLString },\n },\n resolve: findVersionsResolver(collection),\n type: buildPaginatedListType(\n `versions${formatName(pluralName)}`,\n collection.graphQL.versionType,\n ),\n }\n graphqlResult.Mutation.fields[`restoreVersion${formatName(singularName)}`] = {\n args: {\n id: { type: versionIDType },\n },\n resolve: restoreVersionResolver(collection),\n type: collection.graphQL.type,\n }\n }\n\n if (collectionConfig.auth) {\n const authFields: Field[] = collectionConfig.auth.disableLocalStrategy\n ? []\n : [\n {\n name: 'email',\n required: true,\n type: 'email',\n },\n ]\n collection.graphQL.JWT = buildObjectType({\n name: formatName(`${slug}JWT`),\n fields: [\n ...collectionConfig.fields.filter((field) => fieldAffectsData(field) && field.saveToJWT),\n ...authFields,\n {\n name: 'collection',\n required: true,\n type: 'text',\n },\n ],\n parentName: formatName(`${slug}JWT`),\n graphqlResult,\n config,\n })\n\n graphqlResult.Query.fields[`me${singularName}`] = {\n resolve: me(collection),\n type: new GraphQLObjectType({\n name: formatName(`${slug}Me`),\n fields: {\n collection: {\n type: GraphQLString,\n },\n exp: {\n type: GraphQLInt,\n },\n token: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.type,\n },\n },\n }),\n }\n\n graphqlResult.Query.fields[`initialized${singularName}`] = {\n resolve: init(collection.config.slug),\n type: GraphQLBoolean,\n }\n\n graphqlResult.Mutation.fields[`refreshToken${singularName}`] = {\n args: {\n token: { type: GraphQLString },\n },\n resolve: refresh(collection),\n type: new GraphQLObjectType({\n name: formatName(`${slug}Refreshed${singularName}`),\n fields: {\n exp: {\n type: GraphQLInt,\n },\n refreshedToken: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.JWT,\n },\n },\n }),\n }\n\n graphqlResult.Mutation.fields[`logout${singularName}`] = {\n resolve: logout(collection),\n type: GraphQLString,\n }\n\n if (!collectionConfig.auth.disableLocalStrategy) {\n if (collectionConfig.auth.maxLoginAttempts > 0) {\n graphqlResult.Mutation.fields[`unlock${singularName}`] = {\n args: {\n email: { type: new GraphQLNonNull(GraphQLString) },\n },\n resolve: unlock(collection),\n type: new GraphQLNonNull(GraphQLBoolean),\n }\n }\n\n graphqlResult.Mutation.fields[`login${singularName}`] = {\n args: {\n email: { type: GraphQLString },\n password: { type: GraphQLString },\n },\n resolve: login(collection),\n type: new GraphQLObjectType({\n name: formatName(`${slug}LoginResult`),\n fields: {\n exp: {\n type: GraphQLInt,\n },\n token: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.type,\n },\n },\n }),\n }\n\n graphqlResult.Mutation.fields[`forgotPassword${singularName}`] = {\n args: {\n disableEmail: { type: GraphQLBoolean },\n email: { type: new GraphQLNonNull(GraphQLString) },\n expiration: { type: GraphQLInt },\n },\n resolve: forgotPassword(collection),\n type: new GraphQLNonNull(GraphQLBoolean),\n }\n\n graphqlResult.Mutation.fields[`resetPassword${singularName}`] = {\n args: {\n password: { type: GraphQLString },\n token: { type: GraphQLString },\n },\n resolve: resetPassword(collection),\n type: new GraphQLObjectType({\n name: formatName(`${slug}ResetPassword`),\n fields: {\n token: { type: GraphQLString },\n user: { type: collection.graphQL.type },\n },\n }),\n }\n\n graphqlResult.Mutation.fields[`verifyEmail${singularName}`] = {\n args: {\n token: { type: GraphQLString },\n },\n resolve: verifyEmail(collection),\n type: GraphQLBoolean,\n }\n }\n }\n })\n}\n\nexport default initCollectionsGraphQL\n"],"names":["GraphQLBoolean","GraphQLInt","GraphQLNonNull","GraphQLObjectType","GraphQLString","flattenTopLevelFields","formatNames","toWords","fieldAffectsData","buildVersionCollectionFields","forgotPassword","init","login","logout","me","refresh","resetPassword","unlock","verifyEmail","buildMutationInputType","getCollectionIDType","buildObjectType","buildPaginatedListType","buildPolicyType","buildWhereInputType","formatName","createResolver","getDeleteResolver","docAccessResolver","findResolver","findByIDResolver","findVersionByIDResolver","findVersionsResolver","restoreVersionResolver","updateResolver","initCollectionsGraphQL","config","graphqlResult","Object","keys","collections","forEach","slug","collection","collectionConfig","fields","graphQL","versions","singularName","pluralName","fromSlug","singular","plural","hasIDField","findIndex","field","name","idType","db","defaultIDType","baseFields","whereInputFields","id","type","push","forceNullableObjectType","Boolean","drafts","forceNullable","parentName","paginatedType","whereInputType","auth","disableLocalStrategy","label","required","createMutationInputType","mutationInputType","updateMutationInputType","filter","Query","args","draft","localization","fallbackLocale","types","fallbackLocaleInputType","locale","localeInputType","resolve","where","limit","page","sort","entity","scope","typeSuffix","Mutation","data","autosave","versionIDType","versionCollectionFields","versionType","authFields","JWT","saveToJWT","exp","token","user","refreshedToken","maxLoginAttempts","email","password","disableEmail","expiration"],"mappings":"AAAA,oCAAoC,GACpC,SACEA,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,QACR,UAAS;AAEhB,SAASC,qBAAqB,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAmB;AAC/E,SAASC,gBAAgB,QAAQ,gBAAe;AAChD,SAASC,4BAA4B,QAAQ,mBAAkB;AAK/D,OAAOC,oBAAoB,sCAAqC;AAChE,OAAOC,UAAU,4BAA2B;AAC5C,OAAOC,WAAW,6BAA4B;AAC9C,OAAOC,YAAY,8BAA6B;AAChD,OAAOC,QAAQ,0BAAyB;AACxC,OAAOC,aAAa,+BAA8B;AAClD,OAAOC,mBAAmB,qCAAoC;AAC9D,OAAOC,YAAY,8BAA6B;AAChD,OAAOC,iBAAiB,mCAAkC;AAC1D,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,8BAA6B;AACzF,OAAOC,qBAAqB,uBAAsB;AAClD,OAAOC,4BAA4B,8BAA6B;AAChE,SAASC,eAAe,QAAQ,yBAAwB;AACxD,OAAOC,yBAAyB,2BAA0B;AAC1D,OAAOC,gBAAgB,6BAA4B;AACnD,OAAOC,oBAAoB,qCAAoC;AAC/D,OAAOC,uBAAuB,qCA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cAAc4D,QAAQ,CAACpD,MAAM,CAAC,CAAC,aAAa,EAAEG,aAAa,CAAC,CAAC,GAAG;oBAC9DiC,MAAM;wBACJ+B,UAAU;4BAAEjD,MAAM3D;wBAAc;wBAChCuG,OAAO;4BAAE5C,MAAM3D;wBAAc;oBAC/B;oBACAqF,SAASzE,cAAc2B;oBACvBoB,MAAM,IAAI5D,kBAAkB;wBAC1BqD,MAAM/B,WAAW,CAAC,EAAEiB,KAAK,aAAa,CAAC;wBACvCG,QAAQ;4BACN8D,OAAO;gCAAE5C,MAAM3D;4BAAc;4BAC7BwG,MAAM;gCAAE7C,MAAMpB,WAAWG,OAAO,CAACiB,IAAI;4BAAC;wBACxC;oBACF;gBACF;gBAEA1B,cAAc4D,QAAQ,CAACpD,MAAM,CAAC,CAAC,WAAW,EAAEG,aAAa,CAAC,CAAC,GAAG;oBAC5DiC,MAAM;wBACJ0B,OAAO;4BAAE5C,MAAM3D;wBAAc;oBAC/B;oBACAqF,SAASvE,YAAYyB;oBACrBoB,MAAM/D;gBACR;YACF;QACF;IACF;AACF;AAEA,eAAemC,uBAAsB"}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/initCollections.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { GraphQLInfo } from 'payload/config'\nimport type { Collection, Field, SanitizedCollectionConfig, SanitizedConfig } from 'payload/types'\n\nimport {\n GraphQLBoolean,\n GraphQLInt,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLString,\n} from 'graphql'\nimport { fieldAffectsData } from 'payload/types'\nimport { flattenTopLevelFields, formatNames, toWords } from 'payload/utilities'\nimport { buildVersionCollectionFields } from 'payload/versions'\n\nimport type { ObjectTypeConfig } from './buildObjectType.js'\n\nimport forgotPassword from '../resolvers/auth/forgotPassword.js'\nimport init from '../resolvers/auth/init.js'\nimport login from '../resolvers/auth/login.js'\nimport logout from '../resolvers/auth/logout.js'\nimport me from '../resolvers/auth/me.js'\nimport refresh from '../resolvers/auth/refresh.js'\nimport resetPassword from '../resolvers/auth/resetPassword.js'\nimport unlock from '../resolvers/auth/unlock.js'\nimport verifyEmail from '../resolvers/auth/verifyEmail.js'\nimport createResolver from '../resolvers/collections/create.js'\nimport getDeleteResolver from '../resolvers/collections/delete.js'\nimport { docAccessResolver } from '../resolvers/collections/docAccess.js'\nimport duplicateResolver from '../resolvers/collections/duplicate.js'\nimport findResolver from '../resolvers/collections/find.js'\nimport findByIDResolver from '../resolvers/collections/findByID.js'\nimport findVersionByIDResolver from '../resolvers/collections/findVersionByID.js'\nimport findVersionsResolver from '../resolvers/collections/findVersions.js'\nimport restoreVersionResolver from '../resolvers/collections/restoreVersion.js'\nimport updateResolver from '../resolvers/collections/update.js'\nimport formatName from '../utilities/formatName.js'\nimport { buildMutationInputType, getCollectionIDType } from './buildMutationInputType.js'\nimport buildObjectType from './buildObjectType.js'\nimport buildPaginatedListType from './buildPaginatedListType.js'\nimport { buildPolicyType } from './buildPoliciesType.js'\nimport buildWhereInputType from './buildWhereInputType.js'\n\ntype InitCollectionsGraphQLArgs = {\n config: SanitizedConfig\n graphqlResult: GraphQLInfo\n}\nfunction initCollectionsGraphQL({ config, graphqlResult }: InitCollectionsGraphQLArgs): void {\n Object.keys(graphqlResult.collections).forEach((slug) => {\n const collection: Collection = graphqlResult.collections[slug]\n const {\n config: collectionConfig,\n config: { fields, graphQL = {} as SanitizedCollectionConfig['graphQL'], versions },\n } = collection\n\n if (!graphQL) return\n\n let singularName\n let pluralName\n const fromSlug = formatNames(collection.config.slug)\n if (graphQL.singularName) {\n singularName = toWords(graphQL.singularName, true)\n } else {\n singularName = fromSlug.singular\n }\n if (graphQL.pluralName) {\n pluralName = toWords(graphQL.pluralName, true)\n } else {\n pluralName = fromSlug.plural\n }\n\n // For collections named 'Media' or similar,\n // there is a possibility that the singular name\n // will equal the plural name. Append `all` to the beginning\n // of potential conflicts\n if (singularName === pluralName) {\n pluralName = `all${singularName}`\n }\n\n collection.graphQL = {} as Collection['graphQL']\n\n const hasIDField =\n flattenTopLevelFields(fields).findIndex(\n (field) => fieldAffectsData(field) && field.name === 'id',\n ) > -1\n\n const idType = getCollectionIDType(config.db.defaultIDType, collectionConfig)\n\n const baseFields: ObjectTypeConfig = {}\n\n const whereInputFields = [...fields]\n\n if (!hasIDField) {\n baseFields.id = { type: idType }\n whereInputFields.push({\n name: 'id',\n type: config.db.defaultIDType as 'text',\n })\n }\n\n const forceNullableObjectType = Boolean(versions?.drafts)\n\n collection.graphQL.type = buildObjectType({\n name: singularName,\n baseFields,\n config,\n fields,\n forceNullable: forceNullableObjectType,\n graphqlResult,\n parentName: singularName,\n })\n\n collection.graphQL.paginatedType = buildPaginatedListType(pluralName, collection.graphQL.type)\n\n collection.graphQL.whereInputType = buildWhereInputType({\n name: singularName,\n fields: whereInputFields,\n parentName: singularName,\n })\n\n if (collectionConfig.auth && !collectionConfig.auth.disableLocalStrategy) {\n fields.push({\n name: 'password',\n type: 'text',\n label: 'Password',\n required: true,\n })\n }\n\n const createMutationInputType = buildMutationInputType({\n name: singularName,\n config,\n fields,\n graphqlResult,\n parentName: singularName,\n })\n if (createMutationInputType) {\n collection.graphQL.mutationInputType = new GraphQLNonNull(createMutationInputType)\n }\n\n const updateMutationInputType = buildMutationInputType({\n name: `${singularName}Update`,\n config,\n fields: fields.filter((field) => !(fieldAffectsData(field) && field.name === 'id')),\n forceNullable: true,\n graphqlResult,\n parentName: `${singularName}Update`,\n })\n if (updateMutationInputType) {\n collection.graphQL.updateMutationInputType = new GraphQLNonNull(updateMutationInputType)\n }\n\n graphqlResult.Query.fields[singularName] = {\n type: collection.graphQL.type,\n args: {\n id: { type: new GraphQLNonNull(idType) },\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: findByIDResolver(collection),\n }\n\n graphqlResult.Query.fields[pluralName] = {\n type: buildPaginatedListType(pluralName, collection.graphQL.type),\n args: {\n draft: { type: GraphQLBoolean },\n where: { type: collection.graphQL.whereInputType },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n limit: { type: GraphQLInt },\n page: { type: GraphQLInt },\n sort: { type: GraphQLString },\n },\n resolve: findResolver(collection),\n }\n\n graphqlResult.Query.fields[`docAccess${singularName}`] = {\n type: buildPolicyType({\n type: 'collection',\n entity: collectionConfig,\n scope: 'docAccess',\n typeSuffix: 'DocAccess',\n }),\n args: {\n id: { type: new GraphQLNonNull(idType) },\n },\n resolve: docAccessResolver(collection),\n }\n\n graphqlResult.Mutation.fields[`create${singularName}`] = {\n type: collection.graphQL.type,\n args: {\n ...(createMutationInputType\n ? { data: { type: collection.graphQL.mutationInputType } }\n : {}),\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: createResolver(collection),\n }\n\n graphqlResult.Mutation.fields[`update${singularName}`] = {\n type: collection.graphQL.type,\n args: {\n id: { type: new GraphQLNonNull(idType) },\n autosave: { type: GraphQLBoolean },\n ...(updateMutationInputType\n ? { data: { type: collection.graphQL.updateMutationInputType } }\n : {}),\n draft: { type: GraphQLBoolean },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: updateResolver(collection),\n }\n\n graphqlResult.Mutation.fields[`delete${singularName}`] = {\n type: collection.graphQL.type,\n args: {\n id: { type: new GraphQLNonNull(idType) },\n },\n resolve: getDeleteResolver(collection),\n }\n\n graphqlResult.Mutation.fields[`duplicate${singularName}`] = {\n type: collection.graphQL.type,\n args: {\n id: { type: new GraphQLNonNull(idType) },\n },\n resolve: duplicateResolver(collection),\n }\n\n if (collectionConfig.versions) {\n const versionIDType = config.db.defaultIDType === 'text' ? GraphQLString : GraphQLInt\n const versionCollectionFields: Field[] = [\n ...buildVersionCollectionFields(collectionConfig),\n {\n name: 'id',\n type: config.db.defaultIDType as 'text',\n },\n {\n name: 'createdAt',\n type: 'date',\n label: 'Created At',\n },\n {\n name: 'updatedAt',\n type: 'date',\n label: 'Updated At',\n },\n ]\n\n collection.graphQL.versionType = buildObjectType({\n name: `${singularName}Version`,\n config,\n fields: versionCollectionFields,\n forceNullable: forceNullableObjectType,\n graphqlResult,\n parentName: `${singularName}Version`,\n })\n\n graphqlResult.Query.fields[`version${formatName(singularName)}`] = {\n type: collection.graphQL.versionType,\n args: {\n id: { type: versionIDType },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: findVersionByIDResolver(collection),\n }\n graphqlResult.Query.fields[`versions${pluralName}`] = {\n type: buildPaginatedListType(\n `versions${formatName(pluralName)}`,\n collection.graphQL.versionType,\n ),\n args: {\n where: {\n type: buildWhereInputType({\n name: `versions${singularName}`,\n fields: versionCollectionFields,\n parentName: `versions${singularName}`,\n }),\n },\n ...(config.localization\n ? {\n fallbackLocale: { type: graphqlResult.types.fallbackLocaleInputType },\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n limit: { type: GraphQLInt },\n page: { type: GraphQLInt },\n sort: { type: GraphQLString },\n },\n resolve: findVersionsResolver(collection),\n }\n graphqlResult.Mutation.fields[`restoreVersion${formatName(singularName)}`] = {\n type: collection.graphQL.type,\n args: {\n id: { type: versionIDType },\n },\n resolve: restoreVersionResolver(collection),\n }\n }\n\n if (collectionConfig.auth) {\n const authFields: Field[] = collectionConfig.auth.disableLocalStrategy\n ? []\n : [\n {\n name: 'email',\n type: 'email',\n required: true,\n },\n ]\n collection.graphQL.JWT = buildObjectType({\n name: formatName(`${slug}JWT`),\n config,\n fields: [\n ...collectionConfig.fields.filter((field) => fieldAffectsData(field) && field.saveToJWT),\n ...authFields,\n {\n name: 'collection',\n type: 'text',\n required: true,\n },\n ],\n graphqlResult,\n parentName: formatName(`${slug}JWT`),\n })\n\n graphqlResult.Query.fields[`me${singularName}`] = {\n type: new GraphQLObjectType({\n name: formatName(`${slug}Me`),\n fields: {\n collection: {\n type: GraphQLString,\n },\n exp: {\n type: GraphQLInt,\n },\n token: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.type,\n },\n },\n }),\n resolve: me(collection),\n }\n\n graphqlResult.Query.fields[`initialized${singularName}`] = {\n type: GraphQLBoolean,\n resolve: init(collection.config.slug),\n }\n\n graphqlResult.Mutation.fields[`refreshToken${singularName}`] = {\n type: new GraphQLObjectType({\n name: formatName(`${slug}Refreshed${singularName}`),\n fields: {\n exp: {\n type: GraphQLInt,\n },\n refreshedToken: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.JWT,\n },\n },\n }),\n args: {\n token: { type: GraphQLString },\n },\n resolve: refresh(collection),\n }\n\n graphqlResult.Mutation.fields[`logout${singularName}`] = {\n type: GraphQLString,\n resolve: logout(collection),\n }\n\n if (!collectionConfig.auth.disableLocalStrategy) {\n if (collectionConfig.auth.maxLoginAttempts > 0) {\n graphqlResult.Mutation.fields[`unlock${singularName}`] = {\n type: new GraphQLNonNull(GraphQLBoolean),\n args: {\n email: { type: new GraphQLNonNull(GraphQLString) },\n },\n resolve: unlock(collection),\n }\n }\n\n graphqlResult.Mutation.fields[`login${singularName}`] = {\n type: new GraphQLObjectType({\n name: formatName(`${slug}LoginResult`),\n fields: {\n exp: {\n type: GraphQLInt,\n },\n token: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.type,\n },\n },\n }),\n args: {\n email: { type: GraphQLString },\n password: { type: GraphQLString },\n },\n resolve: login(collection),\n }\n\n graphqlResult.Mutation.fields[`forgotPassword${singularName}`] = {\n type: new GraphQLNonNull(GraphQLBoolean),\n args: {\n disableEmail: { type: GraphQLBoolean },\n email: { type: new GraphQLNonNull(GraphQLString) },\n expiration: { type: GraphQLInt },\n },\n resolve: forgotPassword(collection),\n }\n\n graphqlResult.Mutation.fields[`resetPassword${singularName}`] = {\n type: new GraphQLObjectType({\n name: formatName(`${slug}ResetPassword`),\n fields: {\n token: { type: GraphQLString },\n user: { type: collection.graphQL.type },\n },\n }),\n args: {\n password: { type: GraphQLString },\n token: { type: GraphQLString },\n },\n resolve: resetPassword(collection),\n }\n\n graphqlResult.Mutation.fields[`verifyEmail${singularName}`] = {\n type: GraphQLBoolean,\n args: {\n token: { type: GraphQLString },\n },\n resolve: verifyEmail(collection),\n }\n }\n }\n })\n}\n\nexport default initCollectionsGraphQL\n"],"names":["GraphQLBoolean","GraphQLInt","GraphQLNonNull","GraphQLObjectType","GraphQLString","fieldAffectsData","flattenTopLevelFields","formatNames","toWords","buildVersionCollectionFields","forgotPassword","init","login","logout","me","refresh","resetPassword","unlock","verifyEmail","createResolver","getDeleteResolver","docAccessResolver","duplicateResolver","findResolver","findByIDResolver","findVersionByIDResolver","findVersionsResolver","restoreVersionResolver","updateResolver","formatName","buildMutationInputType","getCollectionIDType","buildObjectType","buildPaginatedListType","buildPolicyType","buildWhereInputType","initCollectionsGraphQL","config","graphqlResult","Object","keys","collections","forEach","slug","collection","collectionConfig","fields","graphQL","versions","singularName","pluralName","fromSlug","singular","plural","hasIDField","findIndex","field","name","idType","db","defaultIDType","baseFields","whereInputFields","id","type","push","forceNullableObjectType","Boolean","drafts","forceNullable","parentName","paginatedType","whereInputType","auth","disableLocalStrategy","label","required","createMutationInputType","mutationInputType","updateMutationInputType","filter","Query","args","draft","localization","fallbackLocale","types","fallbackLocaleInputType","locale","localeInputType","resolve","where","limit","page","sort","entity","scope","typeSuffix","Mutation","data","autosave","versionIDType","versionCollectionFields","versionType","authFields","JWT","saveToJWT","exp","token","user","refreshedToken","maxLoginAttempts","email","password","disableEmail","expiration"],"mappings":"AAAA,oCAAoC,GAIpC,SACEA,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,QACR,UAAS;AAChB,SAASC,gBAAgB,QAAQ,gBAAe;AAChD,SAASC,qBA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c;oBAC/B;oBACAsF,SAAS1E,cAAc4B;gBACzB;gBAEAN,cAAc4D,QAAQ,CAACpD,MAAM,CAAC,CAAC,WAAW,EAAEG,aAAa,CAAC,CAAC,GAAG;oBAC5De,MAAMhE;oBACNkF,MAAM;wBACJ0B,OAAO;4BAAE5C,MAAM5D;wBAAc;oBAC/B;oBACAsF,SAASxE,YAAY0B;gBACvB;YACF;QACF;IACF;AACF;AAEA,eAAeR,uBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initGlobals.d.ts","sourceRoot":"","sources":["../../src/schema/initGlobals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initGlobals.d.ts","sourceRoot":"","sources":["../../src/schema/initGlobals.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAS,eAAe,EAAyB,MAAM,eAAe,CAAA;AAkBlF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,eAAe,CAAA;IACvB,aAAa,EAAE,WAAW,CAAA;CAC3B,CAAA;AACD,iBAAS,kBAAkB,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAyJnF;AAED,eAAe,kBAAkB,CAAA"}
|