Files
payload/test/joins/collections/Versions.ts
Sasha e5690fcab9 fix(graphql): respect draft: true when querying joins (#11869)
The same as https://github.com/payloadcms/payload/pull/11763 but also
for GraphQL. The previous fix was working only for the Local API and
REST API due to a different method for querying joins in GraphQL.
2025-04-01 14:41:47 -04:00

34 lines
632 B
TypeScript

import type { CollectionConfig } from 'payload'
export const versionsSlug = 'versions'
export const Versions: CollectionConfig = {
slug: versionsSlug,
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'category',
relationTo: 'categories',
type: 'relationship',
},
{
name: 'categoryVersion',
relationTo: 'categories-versions',
type: 'relationship',
},
{
name: 'categoryVersions',
relationTo: 'categories-versions',
type: 'relationship',
hasMany: true,
},
],
versions: {
drafts: true,
},
}