Skip to content

Commit

Permalink
add documentation conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Oct 10, 2022
1 parent d476534 commit 70bc49f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/pages/docs/config/lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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

Expand Down

0 comments on commit 70bc49f

Please sign in to comment.