Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move @keystone-next/keystone/schema to @keystone-next/keystone #6378

Merged
merged 2 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-wolves-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': major
---

Moved exports of `@keystone-next/keystone/schema` to `@keystone-next/keystone`
2 changes: 1 addition & 1 deletion docs/components/docs/DocumentEditorDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const componentBlocks = {
type DocumentFieldConfig = Parameters<typeof import('@keystone-next/fields-document').document>[0];

function documentFeaturesCodeExample(config: DocumentFieldConfig | DocumentFeatures) {
return `import { config, createSchema, list } from '@keystone-next/keystone/schema';
return `import { config, createSchema, list } from '@keystone-next/keystone';
import { document } from '@keystone-next/fields-document';

export default config({
Expand Down
20 changes: 10 additions & 10 deletions docs/pages/docs/apis/access-control.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Markdown } from '../../../components/Markdown';
The `access` property of the [list configuration](./schema) and [field configuration](./fields) objects configures who can read, create, update, and delete items in your Keystone system.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -35,7 +35,7 @@ Verbose syntax provides a separate access control rule for each operation type;
Concise syntax provides a single access control rule which is used for all operation types.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -73,7 +73,7 @@ If you want to keep the operations in the GraphQL API while preventing all acces
The excluded operations can still be access by using [`context.sudo()`](./context#new-context-creators).

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';

export default config({
lists: createSchema({
Expand All @@ -97,7 +97,7 @@ For singular operations, e.g. `updateItem` or `deleteItem`, if the merged filter
For multi-item operations, e.g. `updateItems` or `deleteItems`, if the merged filter excludes items then these will simply be ignored by the operation, giving the same behaviour as if the ID was missing.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { checkbox } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -131,7 +131,7 @@ If the function returns:
- **a declarative value** then this will be applied to the operation as described [above](#declarative-list).

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';

export default config({
lists: createSchema({
Expand All @@ -157,7 +157,7 @@ Imperative access control functions are passed a collection of arguments which c
| `context` | The [`KeystoneContext`](./context) object of the originating GraphQL operation. |

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -190,7 +190,7 @@ Verbose syntax provides a separate access control rule for each operation type;
Concise syntax provides a single access control rule which is used for all operation types.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -232,7 +232,7 @@ If you want to keep the fields in the GraphQL API while preventing all access, y
The excluded operations can still be access by using [`context.sudo()`](./context#new-context-creators).

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -260,7 +260,7 @@ If the function returns `false` then an `Access Denied` error will be returned.
If the function returns `true` then the operation will be allowed.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -292,7 +292,7 @@ Imperative access control functions are passed a collection of arguments which c
| `item` | The item being updated, deleted, or read. This object is an unresolved list item. See the [list item API](./list-items) for more details on unresolved list items. |

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Additional options to this function provide support for creating an initial item
For examples of how to use authentication in your system please see the [authentication guide](../guides/auth).

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text, password, checkbox } from '@keystone-next/keystone/fields';
import { createAuth } from '@keystone-next/auth';

Expand Down
12 changes: 6 additions & 6 deletions docs/pages/docs/apis/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Markdown } from '../../../components/Markdown';
The `keystone-next` [CLI](../guides/cli) expects to find a module named `keystone.ts` with a default export of a Keystone system configuration returned from the function `config()`.

```typescript filename=keystone.ts
import { config } from '@keystone-next/keystone/schema';
import { config } from '@keystone-next/keystone';

export default config({ /* ... */ });
```
Expand Down Expand Up @@ -41,7 +41,7 @@ See the [Schema API](./schema) docs for details on how to use this function.

```typescript
import type { ListSchemaConfig } from '@keystone-next/keystone/types';
import { config, createSchema } from '@keystone-next/keystone/schema';
import { config, createSchema } from '@keystone-next/keystone';

export default config({
lists: createSchema({ /* ... */ }),
Expand Down Expand Up @@ -314,7 +314,7 @@ It has a TypeScript type of `ExtendGraphqlSchema`.
In general you will use the function `graphQLSchemaExtension({ typeDefs, resolvers })` to create your schema extension.

```typescript
import { config, graphQLSchemaExtension } from '@keystone-next/keystone/schema';
import { config, graphQLSchemaExtension } from '@keystone-next/keystone';

export default config({
extendGraphqlSchema: graphQLSchemaExtension({ typeDefs, resolvers }),
Expand All @@ -331,7 +331,7 @@ In order to use this field type you need to configure Keystone with information
At the moment Keystone supports storing files on the local filesystem, and is agnostic about how files are served.

```typescript
import { config } from '@keystone-next/keystone/schema';
import { config } from '@keystone-next/keystone';

export default config({
files: {
Expand Down Expand Up @@ -359,7 +359,7 @@ In order to use this field type you need to configure Keystone with information
At the moment Keystone supports storing files on the local filesystem, and is agnostic about how images are served.

```typescript
import { config } from '@keystone-next/keystone/schema';
import { config } from '@keystone-next/keystone';

export default config({
images: {
Expand All @@ -386,7 +386,7 @@ The following flags allow you to enable features which are still in preview.
These features are not guaranteed to work, and should be used with caution.

```typescript
import { config } from '@keystone-next/keystone/schema';
import { config } from '@keystone-next/keystone';

export default config({
experimental: {
Expand Down
34 changes: 17 additions & 17 deletions docs/pages/docs/apis/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document covers the different field types which are available and the confi
To see how to access fields in the GraphQL API please see the [GraphQL API](./graphql) docs.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import {
// Scalar types
checkbox,
Expand Down Expand Up @@ -132,7 +132,7 @@ Options:
- `isRequired` (default: `false`): If `true` then this field can never be set to `null`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { checkbox } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -166,7 +166,7 @@ Options:
- `isUnique` (default: `false`): If `true` then all values of this field must be unique. This will also allow you to uniquely filter by this field in the GraphQL API.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { integer } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -195,7 +195,7 @@ Currently the `json` field is non-orderable and non-filterable.
- `isRequired` (default: `false`): If `true` then this field can never be set to `null`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { json } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -228,7 +228,7 @@ Options:
- `isUnique` (default: `false`): If `true` then all values of this field must be unique.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { float } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -265,7 +265,7 @@ Options:
- `isUnique` (default: `false`): If `true` then all values of this field must be unique.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { decimal } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -301,7 +301,7 @@ Options:
This module will be used for all encryption routines in the `password` field.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { password } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -347,7 +347,7 @@ Options:
Can be one of `['select', 'segmented-control']`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { select } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -390,7 +390,7 @@ Options:
Can be one of `['input', 'textarea']`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -427,7 +427,7 @@ Options:
- `isUnique` (default: `false`): If `true` then all values of this field must be unique.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { timestamp } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -477,7 +477,7 @@ Read our [relationships guide](../guides/relationships) for details on Keystone
- `ui.displayMode === 'count'` only supports `many` relationships

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { relationship } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -528,7 +528,7 @@ Options:
- `isUnique`

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { autoIncrement } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -562,7 +562,7 @@ Options:
- `graphQLReturnFragment` (default: `''` ): The sub-fields that should be fetched by the Admin UI when displaying this field.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { virtual } from '@keystone-next/keystone/fields';
import { schema } from '@keystone-next/keystone/types';

Expand Down Expand Up @@ -603,7 +603,7 @@ Options:
- `isRequired` (default: `false`): If `true` then this field can never be set to `null`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { file } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -633,7 +633,7 @@ Options:
- `isRequired` (default: `false`): If `true` then this field can never be set to `null`.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { image } from '@keystone-next/keystone/fields';

export default config({
Expand Down Expand Up @@ -668,7 +668,7 @@ Options:
- `layouts`

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { document } from '@keystone-next/fields-document';

export default config({
Expand Down Expand Up @@ -707,7 +707,7 @@ export default config({
- `folder`

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { cloudinaryImage } from '@keystone-next/cloudinary';

export default config({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Keystone generates a CRUD (create, read, update, delete) GraphQL API based on th
Consider the following system definition:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { config, createSchema, list } from '@keystone-next/keystone';
import { text } from '@keystone-next/keystone/fields';

export default config({
Expand Down
Loading