Skip to content

Commit

Permalink
Minor doc fixes (keystonejs#7159)
Browse files Browse the repository at this point in the history
* Removing reference to the "list" api

* The document field is no longer "coming soon"

* Fixing indentation in virtual field example

* Fixing graphql imports
  • Loading branch information
molomby authored Jan 12, 2022
1 parent eb57949 commit 44f815a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ context = {

### GraphQL helpers

`graphql.schema`: The [GraphQL Schema](https://graphql.org/graphql-js/type/#graphqlschema) object, which can be used directly, or via `graphql.raw`, `graphql.run`, or the `lists` API.
`graphql.schema`: The [GraphQL Schema](https://graphql.org/graphql-js/type/#graphqlschema) object, which can be used directly, or via `graphql.raw` and `graphql.run`.

`graphql.raw`: An async function which takes `({ query, variables })` and executes the query against the GraphQL schema, returning `{ data, errors }`.
`query` can be either a string or a GraphQL [`Document`](https://graphql.org/graphql-js/language/#parse).
Expand Down
7 changes: 5 additions & 2 deletions docs/pages/docs/apis/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ Options:
or an enum or you need to provide arguments to the field.

```typescript
import { config, createSchema, list, graphql } from '@keystone-6/core';
import { config, createSchema, graphql, list } from '@keystone-6/core';
import { virtual } from '@keystone-6/core/fields';

export default config({
Expand Down Expand Up @@ -765,7 +765,10 @@ export default config({

### document

(coming soon)
A highly customizable, [Slate](https://docs.slatejs.org/)-based, rich text editor that lets content creators quickly and easily edit content in your system.
See the [Document Field guild](https://keystonejs.com/docs/guides/document-fields),
[demo](https://keystonejs.com/docs/guides/document-field-demo) and
[example project](https://github.com/keystonejs/keystone/tree/main/examples/document-field) for details.

Options:

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/guides/virtual-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In this guide we'll introduce the syntax for adding virtual fields, and show how
We'll start with a list called `Example` and create a virtual field called `hello`.

```typescript
import { config, createSchema, list, graphql } from '@keystone-6/core';
import { config, createSchema, graphql, list } from '@keystone-6/core';
import { virtual } from '@keystone-6/core/fields';

export default config({
Expand Down Expand Up @@ -94,7 +94,7 @@ export default config({
author: relationship({ ref: 'Author', many: false }),
authorName: virtual({
field: graphql.field({
type: graphql.String,
type: graphql.String,
async resolve(item, args, context) {
const { author } = await context.query.Post.findOne({
where: { id: item.id.toString() },
Expand Down

0 comments on commit 44f815a

Please sign in to comment.