@payloadcms/graphql 3.5.1-canary.d9bd64a → 3.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,8BAA8B,EAC/B,MAAM,SAAS,CAAA;AAMhB,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,cAAc,IAAI,CACnD,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAA;IAC3C,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAA;AAE3C,wBAAgB,cAAc,CAAC,KAAK,SAAS,cAAc,EACzD,UAAU,EAAE,UAAU,GACrB,QAAQ,CAAC,KAAK,CAAC,CAkBjB"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,8BAA8B,EAC/B,MAAM,SAAS,CAAA;AAMhB,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,cAAc,IAAI,CACnD,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAA;IAC3C,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAA;AAE3C,wBAAgB,cAAc,CAAC,KAAK,SAAS,cAAc,EACzD,UAAU,EAAE,UAAU,GACrB,QAAQ,CAAC,KAAK,CAAC,CAgBjB"}
@@ -4,14 +4,13 @@ export function createResolver(collection) {
4
4
  if (args.locale) {
5
5
  context.req.locale = args.locale;
6
6
  }
7
- const options = {
7
+ const result = await createOperation({
8
8
  collection,
9
9
  data: args.data,
10
10
  depth: 0,
11
11
  draft: args.draft,
12
12
  req: isolateObjectProperty(context.req, 'transactionID')
13
- };
14
- const result = await createOperation(options);
13
+ });
15
14
  return result;
16
15
  };
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/resolvers/collections/create.ts"],"sourcesContent":["import type {\n Collection,\n CollectionSlug,\n DataFromCollectionSlug,\n PayloadRequest,\n RequiredDataFromCollectionSlug,\n} from 'payload'\n\nimport { createOperation, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<TSlug extends CollectionSlug> = (\n _: unknown,\n args: {\n data: RequiredDataFromCollectionSlug<TSlug>\n draft: boolean\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<DataFromCollectionSlug<TSlug>>\n\nexport function createResolver<TSlug extends CollectionSlug>(\n collection: Collection,\n): Resolver<TSlug> {\n return async function resolver(_, args, context: Context) {\n if (args.locale) {\n context.req.locale = args.locale\n }\n\n const options = {\n collection,\n data: args.data,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await createOperation(options)\n\n return result\n }\n}\n"],"names":["createOperation","isolateObjectProperty","createResolver","collection","resolver","_","args","context","locale","req","options","data","depth","draft","result"],"mappings":"AAQA,SAASA,eAAe,EAAEC,qBAAqB,QAAQ,UAAS;AAgBhE,OAAO,SAASC,eACdC,UAAsB;IAEtB,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAID,KAAKE,MAAM,EAAE;YACfD,QAAQE,GAAG,CAACD,MAAM,GAAGF,KAAKE,MAAM;QAClC;QAEA,MAAME,UAAU;YACdP;YACAQ,MAAML,KAAKK,IAAI;YACfC,OAAO;YACPC,OAAOP,KAAKO,KAAK;YACjBJ,KAAKR,sBAAsBM,QAAQE,GAAG,EAAE;QAC1C;QAEA,MAAMK,SAAS,MAAMd,gBAAgBU;QAErC,OAAOI;IACT;AACF"}
1
+ {"version":3,"sources":["../../../src/resolvers/collections/create.ts"],"sourcesContent":["import type {\n Collection,\n CollectionSlug,\n DataFromCollectionSlug,\n PayloadRequest,\n RequiredDataFromCollectionSlug,\n} from 'payload'\n\nimport { createOperation, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<TSlug extends CollectionSlug> = (\n _: unknown,\n args: {\n data: RequiredDataFromCollectionSlug<TSlug>\n draft: boolean\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<DataFromCollectionSlug<TSlug>>\n\nexport function createResolver<TSlug extends CollectionSlug>(\n collection: Collection,\n): Resolver<TSlug> {\n return async function resolver(_, args, context: Context) {\n if (args.locale) {\n context.req.locale = args.locale\n }\n\n const result = await createOperation({\n collection,\n data: args.data,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(context.req, 'transactionID'),\n })\n\n return result\n }\n}\n"],"names":["createOperation","isolateObjectProperty","createResolver","collection","resolver","_","args","context","locale","req","result","data","depth","draft"],"mappings":"AAQA,SAASA,eAAe,EAAEC,qBAAqB,QAAQ,UAAS;AAgBhE,OAAO,SAASC,eACdC,UAAsB;IAEtB,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAID,KAAKE,MAAM,EAAE;YACfD,QAAQE,GAAG,CAACD,MAAM,GAAGF,KAAKE,MAAM;QAClC;QAEA,MAAME,SAAS,MAAMV,gBAAgB;YACnCG;YACAQ,MAAML,KAAKK,IAAI;YACfC,OAAO;YACPC,OAAOP,KAAKO,KAAK;YACjBJ,KAAKR,sBAAsBM,QAAQE,GAAG,EAAE;QAC1C;QAEA,OAAOC;IACT;AACF"}
@@ -1,5 +1,6 @@
1
1
  import type { Collection, CollectionSlug, DataFromCollectionSlug, PayloadRequest } from 'payload';
2
2
  export type Resolver<TData> = (_: unknown, args: {
3
+ data: TData;
3
4
  draft: boolean;
4
5
  fallbackLocale?: string;
5
6
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAMjG,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI,CAC5B,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,KAAK,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,KAAK,CAAC,CAAA;AAEnB,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,cAAc,EAC5D,UAAU,EAAE,UAAU,GACrB,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAqBzC"}
1
+ {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAMjG,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI,CAC5B,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,IAAI,EAAE,KAAK,CAAA;IACX,KAAK,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,KAAK,CAAC,CAAA;AAEnB,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,cAAc,EAC5D,UAAU,EAAE,UAAU,GACrB,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAoBzC"}
@@ -7,14 +7,14 @@ export function duplicateResolver(collection) {
7
7
  req.locale = args.locale || locale;
8
8
  req.fallbackLocale = args.fallbackLocale || fallbackLocale;
9
9
  context.req = req;
10
- const options = {
10
+ const result = await duplicateOperation({
11
11
  id: args.id,
12
12
  collection,
13
+ data: args.data,
13
14
  depth: 0,
14
15
  draft: args.draft,
15
16
  req: isolateObjectProperty(req, 'transactionID')
16
- };
17
- const result = await duplicateOperation(options);
17
+ });
18
18
  return result;
19
19
  };
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/resolvers/collections/duplicate.ts"],"sourcesContent":["import type { Collection, CollectionSlug, DataFromCollectionSlug, PayloadRequest } from 'payload'\n\nimport { duplicateOperation, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<TData> = (\n _: unknown,\n args: {\n draft: boolean\n fallbackLocale?: string\n id: string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<TData>\n\nexport function duplicateResolver<TSlug extends CollectionSlug>(\n collection: Collection,\n): Resolver<DataFromCollectionSlug<TSlug>> {\n return async function resolver(_, args, context: Context) {\n const { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n context.req = req\n\n const options = {\n id: args.id,\n collection,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(req, 'transactionID'),\n }\n\n const result = await duplicateOperation(options)\n\n return result\n }\n}\n"],"names":["duplicateOperation","isolateObjectProperty","duplicateResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","id","depth","draft","result"],"mappings":"AAEA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ,UAAS;AAiBnE,OAAO,SAASC,kBACdC,UAAsB;IAEtB,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,MAAM,EAAEC,GAAG,EAAE,GAAGD;QAChB,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAC5CH,QAAQC,GAAG,GAAGA;QAEd,MAAMG,UAAU;YACdC,IAAIN,KAAKM,EAAE;YACXT;YACAU,OAAO;YACPC,OAAOR,KAAKQ,KAAK;YACjBN,KAAKP,sBAAsBO,KAAK;QAClC;QAEA,MAAMO,SAAS,MAAMf,mBAAmBW;QAExC,OAAOI;IACT;AACF"}
1
+ {"version":3,"sources":["../../../src/resolvers/collections/duplicate.ts"],"sourcesContent":["import type { Collection, CollectionSlug, DataFromCollectionSlug, PayloadRequest } from 'payload'\n\nimport { duplicateOperation, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<TData> = (\n _: unknown,\n args: {\n data: TData\n draft: boolean\n fallbackLocale?: string\n id: string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<TData>\n\nexport function duplicateResolver<TSlug extends CollectionSlug>(\n collection: Collection,\n): Resolver<DataFromCollectionSlug<TSlug>> {\n return async function resolver(_, args, context: Context) {\n const { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n context.req = req\n\n const result = await duplicateOperation({\n id: args.id,\n collection,\n data: args.data,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(req, 'transactionID'),\n })\n\n return result\n }\n}\n"],"names":["duplicateOperation","isolateObjectProperty","duplicateResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","result","id","data","depth","draft"],"mappings":"AAEA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ,UAAS;AAkBnE,OAAO,SAASC,kBACdC,UAAsB;IAEtB,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,MAAM,EAAEC,GAAG,EAAE,GAAGD;QAChB,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAC5CH,QAAQC,GAAG,GAAGA;QAEd,MAAMG,SAAS,MAAMX,mBAAmB;YACtCY,IAAIN,KAAKM,EAAE;YACXT;YACAU,MAAMP,KAAKO,IAAI;YACfC,OAAO;YACPC,OAAOT,KAAKS,KAAK;YACjBP,KAAKP,sBAAsBO,KAAK;QAClC;QAEA,OAAOG;IACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"initCollections.d.ts","sourceRoot":"","sources":["../../src/schema/initCollections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EAEX,eAAe,EAChB,MAAM,SAAS,CAAA;AAyChB,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,aAAa,EAAE,WAAW,CAAA;CAC3B,CAAA;AACD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,0BAA0B,GAAG,IAAI,CA6d3F"}
1
+ {"version":3,"file":"initCollections.d.ts","sourceRoot":"","sources":["../../src/schema/initCollections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EAEX,eAAe,EAChB,MAAM,SAAS,CAAA;AAyChB,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,aAAa,EAAE,WAAW,CAAA;CAC3B,CAAA;AACD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,0BAA0B,GAAG,IAAI,CAge3F"}
@@ -264,7 +264,12 @@ export function initCollections({ config, graphqlResult }) {
264
264
  args: {
265
265
  id: {
266
266
  type: new GraphQLNonNull(idType)
267
- }
267
+ },
268
+ ...createMutationInputType ? {
269
+ data: {
270
+ type: collection.graphQL.mutationInputType
271
+ }
272
+ } : {}
268
273
  },
269
274
  resolve: duplicateResolver(collection)
270
275
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/initCollections.ts"],"sourcesContent":["import type {\n Collection,\n Field,\n GraphQLInfo,\n SanitizedCollectionConfig,\n SanitizedConfig,\n} from 'payload'\n\nimport {\n GraphQLBoolean,\n GraphQLInt,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLString,\n} from 'graphql'\nimport { buildVersionCollectionFields, flattenTopLevelFields, formatNames, toWords } from 'payload'\nimport { fieldAffectsData, getLoginOptions } from 'payload/shared'\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 { countResolver } from '../resolvers/collections/count.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}\nexport function initCollections({ 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) {\n return\n }\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: new GraphQLNonNull(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 const mutationInputFields = [...fields]\n\n if (\n collectionConfig.auth &&\n (!collectionConfig.auth.disableLocalStrategy ||\n (typeof collectionConfig.auth.disableLocalStrategy === 'object' &&\n collectionConfig.auth.disableLocalStrategy.optionalPassword))\n ) {\n mutationInputFields.push({\n name: 'password',\n type: 'text',\n label: 'Password',\n required: !(\n typeof collectionConfig.auth.disableLocalStrategy === 'object' &&\n collectionConfig.auth.disableLocalStrategy.optionalPassword\n ),\n })\n }\n\n const createMutationInputType = buildMutationInputType({\n name: singularName,\n config,\n fields: mutationInputFields,\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: mutationInputFields.filter(\n (field) => !(fieldAffectsData(field) && field.name === 'id'),\n ),\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[`count${pluralName}`] = {\n type: new GraphQLObjectType({\n name: `count${pluralName}`,\n fields: {\n totalDocs: { type: GraphQLInt },\n },\n }),\n args: {\n draft: { type: GraphQLBoolean },\n where: { type: collection.graphQL.whereInputType },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: countResolver(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 if (collectionConfig.disableDuplicate !== true) {\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\n if (collectionConfig.versions) {\n const versionIDType = config.db.defaultIDType === 'text' ? GraphQLString : GraphQLInt\n const versionCollectionFields: Field[] = [\n ...buildVersionCollectionFields(config, 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 draft: { type: GraphQLBoolean },\n },\n resolve: restoreVersionResolver(collection),\n }\n }\n\n if (collectionConfig.auth) {\n const authFields: Field[] =\n collectionConfig.auth.disableLocalStrategy ||\n (collectionConfig.auth.loginWithUsername &&\n !collectionConfig.auth.loginWithUsername.allowEmailLogin &&\n !collectionConfig.auth.loginWithUsername.requireEmail)\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 strategy: {\n type: GraphQLString,\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 strategy: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.JWT,\n },\n },\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 const authArgs = {}\n\n const { canLoginWithEmail, canLoginWithUsername } = getLoginOptions(\n collectionConfig.auth.loginWithUsername,\n )\n\n if (canLoginWithEmail) {\n authArgs['email'] = { type: new GraphQLNonNull(GraphQLString) }\n }\n if (canLoginWithUsername) {\n authArgs['username'] = { type: new GraphQLNonNull(GraphQLString) }\n }\n\n if (collectionConfig.auth.maxLoginAttempts > 0) {\n graphqlResult.Mutation.fields[`unlock${singularName}`] = {\n type: new GraphQLNonNull(GraphQLBoolean),\n args: authArgs,\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 ...authArgs,\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 expiration: { type: GraphQLInt },\n ...authArgs,\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"],"names":["GraphQLBoolean","GraphQLInt","GraphQLNonNull","GraphQLObjectType","GraphQLString","buildVersionCollectionFields","flattenTopLevelFields","formatNames","toWords","fieldAffectsData","getLoginOptions","forgotPassword","init","login","logout","me","refresh","resetPassword","unlock","verifyEmail","countResolver","createResolver","getDeleteResolver","docAccessResolver","duplicateResolver","findResolver","findByIDResolver","findVersionByIDResolver","findVersionsResolver","restoreVersionResolver","updateResolver","formatName","buildMutationInputType","getCollectionIDType","buildObjectType","buildPaginatedListType","buildPolicyType","buildWhereInputType","initCollections","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","mutationInputFields","auth","disableLocalStrategy","optionalPassword","label","required","createMutationInputType","mutationInputType","updateMutationInputType","filter","Query","args","draft","localization","fallbackLocale","types","fallbackLocaleInputType","locale","localeInputType","resolve","where","limit","page","sort","totalDocs","entity","scope","typeSuffix","Mutation","data","autosave","disableDuplicate","versionIDType","versionCollectionFields","versionType","authFields","loginWithUsername","allowEmailLogin","requireEmail","JWT","saveToJWT","exp","strategy","token","user","refreshedToken","authArgs","canLoginWithEmail","canLoginWithUsername","maxLoginAttempts","password","disableEmail","expiration"],"mappings":"AAQA,SACEA,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,QACR,UAAS;AAChB,SAASC,4BAA4B,EAAEC,qBAAqB,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAS;AACnG,SAASC,gBAAgB,EAAEC,eAAe,QAAQ,iBAAgB;AAIlE,SAASC,cAAc,QAAQ,sCAAqC;AACpE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,KAAK,QAAQ,6BAA4B;AAClD,SAASC,MAAM,QAAQ,8BAA6B;AACpD,SAASC,EAAE,QAAQ,0BAAyB;AAC5C,SAASC,OAAO,QAAQ,+BAA8B;AACtD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,MAAM,QAAQ,8BAA6B;AACpD,SAASC,WAAW,QAAQ,mCAAkC;AAC9D,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,qCAAoC;AACnE,SAASC,iBAAiB,QAAQ,qCAAoC;AACtE,SAASC,iBAAiB,QAAQ,wCAAuC;AACzE,SAASC,iBAAiB,QAAQ,wCAAuC;AACzE,SAASC,YAAY,QAAQ,mCAAkC;AAC/D,SAASC,gBAAgB,QAAQ,u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ACvD,MAAM,CAAC,CAAC,cAAc,EAAEG,cAAc,CAAC,GAAG;oBAC/De,MAAM,IAAIhE,eAAeF;oBACzBsF,MAAM;wBACJwC,cAAc;4BAAE5D,MAAMlE;wBAAe;wBACrC+H,YAAY;4BAAE7D,MAAMjE;wBAAW;wBAC/B,GAAGwH,QAAQ;oBACb;oBACA3B,SAASnF,eAAemC;gBAC1B;gBAEAN,cAAc+D,QAAQ,CAACvD,MAAM,CAAC,CAAC,aAAa,EAAEG,cAAc,CAAC,GAAG;oBAC9De,MAAM,IAAI/D,kBAAkB;wBAC1BwD,MAAM5B,WAAW,GAAGc,KAAK,aAAa,CAAC;wBACvCG,QAAQ;4BACNsE,OAAO;gCAAEpD,MAAM9D;4BAAc;4BAC7BmH,MAAM;gCAAErD,MAAMpB,WAAWG,OAAO,CAACiB,IAAI;4BAAC;wBACxC;oBACF;oBACAoB,MAAM;wBACJuC,UAAU;4BAAE3D,MAAM9D;wBAAc;wBAChCkH,OAAO;4BAAEpD,MAAM9D;wBAAc;oBAC/B;oBACA0F,SAAS7E,cAAc6B;gBACzB;gBAEAN,cAAc+D,QAAQ,CAACvD,MAAM,CAAC,CAAC,WAAW,EAAEG,cAAc,CAAC,GAAG;oBAC5De,MAAMlE;oBACNsF,MAAM;wBACJgC,OAAO;4BAAEpD,MAAM9D;wBAAc;oBAC/B;oBACA0F,SAAS3E,YAAY2B;gBACvB;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/schema/initCollections.ts"],"sourcesContent":["import type {\n Collection,\n Field,\n GraphQLInfo,\n SanitizedCollectionConfig,\n SanitizedConfig,\n} from 'payload'\n\nimport {\n GraphQLBoolean,\n GraphQLInt,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLString,\n} from 'graphql'\nimport { buildVersionCollectionFields, flattenTopLevelFields, formatNames, toWords } from 'payload'\nimport { fieldAffectsData, getLoginOptions } from 'payload/shared'\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 { countResolver } from '../resolvers/collections/count.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}\nexport function initCollections({ 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) {\n return\n }\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: new GraphQLNonNull(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 const mutationInputFields = [...fields]\n\n if (\n collectionConfig.auth &&\n (!collectionConfig.auth.disableLocalStrategy ||\n (typeof collectionConfig.auth.disableLocalStrategy === 'object' &&\n collectionConfig.auth.disableLocalStrategy.optionalPassword))\n ) {\n mutationInputFields.push({\n name: 'password',\n type: 'text',\n label: 'Password',\n required: !(\n typeof collectionConfig.auth.disableLocalStrategy === 'object' &&\n collectionConfig.auth.disableLocalStrategy.optionalPassword\n ),\n })\n }\n\n const createMutationInputType = buildMutationInputType({\n name: singularName,\n config,\n fields: mutationInputFields,\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: mutationInputFields.filter(\n (field) => !(fieldAffectsData(field) && field.name === 'id'),\n ),\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[`count${pluralName}`] = {\n type: new GraphQLObjectType({\n name: `count${pluralName}`,\n fields: {\n totalDocs: { type: GraphQLInt },\n },\n }),\n args: {\n draft: { type: GraphQLBoolean },\n where: { type: collection.graphQL.whereInputType },\n ...(config.localization\n ? {\n locale: { type: graphqlResult.types.localeInputType },\n }\n : {}),\n },\n resolve: countResolver(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 if (collectionConfig.disableDuplicate !== true) {\n graphqlResult.Mutation.fields[`duplicate${singularName}`] = {\n type: collection.graphQL.type,\n args: {\n id: { type: new GraphQLNonNull(idType) },\n ...(createMutationInputType\n ? { data: { type: collection.graphQL.mutationInputType } }\n : {}),\n },\n resolve: duplicateResolver(collection),\n }\n }\n\n if (collectionConfig.versions) {\n const versionIDType = config.db.defaultIDType === 'text' ? GraphQLString : GraphQLInt\n const versionCollectionFields: Field[] = [\n ...buildVersionCollectionFields(config, 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 draft: { type: GraphQLBoolean },\n },\n resolve: restoreVersionResolver(collection),\n }\n }\n\n if (collectionConfig.auth) {\n const authFields: Field[] =\n collectionConfig.auth.disableLocalStrategy ||\n (collectionConfig.auth.loginWithUsername &&\n !collectionConfig.auth.loginWithUsername.allowEmailLogin &&\n !collectionConfig.auth.loginWithUsername.requireEmail)\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 strategy: {\n type: GraphQLString,\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 strategy: {\n type: GraphQLString,\n },\n user: {\n type: collection.graphQL.JWT,\n },\n },\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 const authArgs = {}\n\n const { canLoginWithEmail, canLoginWithUsername } = getLoginOptions(\n collectionConfig.auth.loginWithUsername,\n )\n\n if (canLoginWithEmail) {\n authArgs['email'] = { type: new GraphQLNonNull(GraphQLString) }\n }\n if (canLoginWithUsername) {\n authArgs['username'] = { type: new GraphQLNonNull(GraphQLString) }\n }\n\n if (collectionConfig.auth.maxLoginAttempts > 0) {\n graphqlResult.Mutation.fields[`unlock${singularName}`] = {\n type: new GraphQLNonNull(GraphQLBoolean),\n args: authArgs,\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 ...authArgs,\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 expiration: { type: GraphQLInt },\n ...authArgs,\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"],"names":["GraphQLBoolean","GraphQLInt","GraphQLNonNull","GraphQLObjectType","GraphQLString","buildVersionCollectionFields","flattenTopLevelFields","formatNames","toWords","fieldAffectsData","getLoginOptions","forgotPassword","init","login","logout","me","refresh","resetPassword","unlock","verifyEmail","countResolver","createResolver","getDeleteResolver","docAccessResolver","duplicateResolver","findResolver","findByIDResolver","findVersionByIDResolver","findVersionsResolver","restoreVersionResolver","updateResolver","formatName","buildMutationInputType","getCollectionIDType","buildObjectType","buildPaginatedListType","buildPolicyType","buildWhereInputType","initCollections","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","mutationInputFields","auth","disableLocalStrategy","optionalPassword","label","required","createMutationInputType","mutationInputType","updateMutationInputType","filter","Query","args","draft","localization","fallbackLocale","types","fallbackLocaleInputType","locale","localeInputType","resolve","where","limit","page","sort","totalDocs","entity","scope","typeSuffix","Mutation","data","autosave","disableDuplicate","versionIDType","versionCollectionFields","versionType","authFields","loginWithUsername","allowEmailLogin","requireEmail","JWT","saveToJWT","exp","strategy","token","user","refreshedToken","authArgs","canLoginWithEmail","canLoginWithUsername","maxLoginAttempts","password","disableEmail","expiration"],"mappings":"AAQA,SACEA,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,QACR,UAAS;AAChB,SAASC,4BAA4B,EAAEC,qBAAqB,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAS;AACnG,SAASC,gBAAgB,EAAEC,eAAe,QAAQ,iBAAg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4BAAE3D,MAAM9D;wBAAc;wBAChCkH,OAAO;4BAAEpD,MAAM9D;wBAAc;oBAC/B;oBACA0F,SAAS7E,cAAc6B;gBACzB;gBAEAN,cAAc+D,QAAQ,CAACvD,MAAM,CAAC,CAAC,WAAW,EAAEG,cAAc,CAAC,GAAG;oBAC5De,MAAMlE;oBACNsF,MAAM;wBACJgC,OAAO;4BAAEpD,MAAM9D;wBAAc;oBAC/B;oBACA0F,SAAS3E,YAAY2B;gBACvB;YACF;QACF;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/graphql",
3
- "version": "3.5.1-canary.d9bd64a",
3
+ "version": "3.6.0",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,12 +51,12 @@
51
51
  "devDependencies": {
52
52
  "@types/pluralize": "^0.0.33",
53
53
  "graphql-http": "^1.22.0",
54
- "@payloadcms/eslint-config": "3.0.0",
55
- "payload": "3.5.1-canary.d9bd64a"
54
+ "payload": "3.6.0",
55
+ "@payloadcms/eslint-config": "3.0.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "graphql": "^16.8.1",
59
- "payload": "3.5.1-canary.d9bd64a"
59
+ "payload": "3.6.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "pnpm build:types && pnpm build:swc",