From 70bc49ff14e3164a3985ca905d3fd6c1247a8e76 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 10 Oct 2022 15:05:13 +1100 Subject: [PATCH] add documentation conditionals --- docs/pages/docs/config/lists.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/pages/docs/config/lists.md b/docs/pages/docs/config/lists.md index 466f42a2f44..0ec6ef2bba7 100644 --- a/docs/pages/docs/config/lists.md +++ b/docs/pages/docs/config/lists.md @@ -165,13 +165,16 @@ Options: - `description` (default: `undefined`): Sets the description of the associated GraphQL type in the generated GraphQL API documentation. Overrides the list-level `description` config option. - `plural`: (default: Pluralised list key, e.g. `'Users'`): Overrides the name used in multiple mutations and queries (e.g. `users()`, `updateUsers()`, etc). +{% if $nextRelease %} - `maxTake` (default: `undefined`): Allows you to specify the maximum `take` number for query operations on this list in the GraphQL API. +{% /if %} - `cacheHint` (default: `undefined`): Allows you to specify the [dynamic cache control hints](https://www.apollographql.com/docs/apollo-server/performance/caching/#in-your-resolvers-dynamic) used for queries to this list. - `omit` (default: `undefined`): Allows you to configure which parts of the CRUD API are autogenerated for your GraphQL API. This option accepts either `true`, or an array of the values `query`, `create`, `update`, or `delete`. If you specify `true` then the entire list, including its output type, will be omitted from the GraphQL API. If you provide an array of `query`, `create`, `update`, or `delete` options, the corresponding operations will be omitted from the GraphQL API. +{% if $nextRelease %} ```typescript import { CacheScope } from 'apollo-cache-control'; import { config, list } from '@keystone-6/core'; @@ -194,6 +197,29 @@ export default config({ /* ... */ }); ``` +{% else /%} +```typescript +import { CacheScope } from 'apollo-cache-control'; +import { config, list } from '@keystone-6/core'; + +export default config({ + lists: { + SomeListName: list({ + graphql: { + description: '...', + itemQueryName: '...', + listQueryName: '...', + cacheHint: { maxAge: 60, scope: CacheScope.Private }, + omit: ['query', 'create', 'update', 'delete'], + }, + /* ... */ + }), + /* ... */ + }, + /* ... */ +}); +``` +{% /if %} ## db