Skip to content

Commit

Permalink
Merge branch 'master' into update-tests-to-use-ssgqlc
Browse files Browse the repository at this point in the history
  • Loading branch information
singhArmani committed Jul 29, 2020
2 parents 792a558 + a8cb4e4 commit e920dd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .changeset/two-dogs-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
'@keystonejs/server-side-graphql-client': major
---

This is the initial release of `@keystonejs/server-side-graphql-client,` a library for running server-side graphQL queries and mutations in Keystone.
This is the initial release of `@keystonejs/server-side-graphql-client,` a library for running server-side graphQL queries and mutations in Keystone.

It is intended to replace the `keystone.createItems` method with a set of utility functions to generate and execute graphQL queries.

Note: In a future change we will remove the `keystone.createItems` method. You will need to update code that used `createItems`.
Note: In a future change we will remove the `keystone.createItems` method. You will need to update code that used `createItems`.

If you have examples like:

Expand All @@ -23,7 +23,7 @@ const { createItems } = require('@keystonejs/server-side-graphql-client');
createItems({
keystone,
listName: 'User',
listKey: 'User',
items: [{ data: { name: 'Ticiana' } }, {data: { name: 'Lauren' } }]
})
```
26 changes: 13 additions & 13 deletions packages/server-side-graphql-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The following config options are common to all server-side graphQL functions.
| Properties | Type | Default | Description |
| -------------- | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `keystone` | `Keystone` | (required) | Keystone instance. |
| `listKey` | `String` | (required) | Keystone list name. |
| `listKey` | `String` | (required) | Keystone list name. |
| `returnFields` | `String` | `id` | A graphQL fragment of fields to return. Must match the graphQL return type. |
| `context` | `Object` | N/A | An Apollo [`context` object](https://www.apollographql.com/docs/apollo-server/data/resolvers/#the-context-argument). See the [server side graphQL docs](/docs/discussions/server-side-graphql.md) for more details. |

Expand Down Expand Up @@ -138,8 +138,8 @@ addUser({ name: 'keystone user', email: '[email protected]' });

[Shared Config Options](#shared-config-options) apply to this function.

| Properties | Type | Default | Description |
| ---------- | ------------------------------- | ---------- | ----------------------- |
| Properties | Type | Default | Description |
| ---------- | ------------------------------ | ---------- | ----------------------- |
| `item` | GraphQL `[listKey]CreateInput` | (required) | The item to be created. |

### `createItems`
Expand Down Expand Up @@ -181,10 +181,10 @@ addUsers();

[Shared Config Options](#shared-config-options) apply to this function.

| Properties | Type | Default | Description |
| ---------- | -------------------------------- | ---------- | ---------------------------------------------------------------------------------------------- |
| Properties | Type | Default | Description |
| ---------- | ------------------------------- | ---------- | ---------------------------------------------------------------------------------------------- |
| `items` | GraphQL `[listKey]sCreateInput` | (required) | The array of objects to be created. |
| `pageSize` | `Number` | 500 | The create mutation batch size. This is useful when you have large set of data to be inserted. |
| `pageSize` | `Number` | 500 | The create mutation batch size. This is useful when you have large set of data to be inserted. |

### `getItem`

Expand Down Expand Up @@ -256,10 +256,10 @@ getUsers();

[Shared Config Options](#shared-config-options) apply to this function.

| Properties | Type | Default | Description |
| ---------- | ------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------- |
| Properties | Type | Default | Description |
| ---------- | ----------------------------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `where` | GraphQL `[listKey]WhereInput` | `{}` | Limit results to items matching [where clause](https://www.keystonejs.com/guides/intro-to-graphql/#where). |
| `pageSize` | `Number` | 500 | The query batch size. Useful when retrieving a large set of data. |
| `pageSize` | `Number` | 500 | The query batch size. Useful when retrieving a large set of data. |

### `updateItem`

Expand Down Expand Up @@ -293,8 +293,8 @@ updateUser({ id: '123', data: { name: 'newName' } });

[Shared Config Options](#shared-config-options) apply to this function.

| Properties | Type | Default | Description |
| ---------- | ------------------------------- | ---------- | ----------------------- |
| Properties | Type | Default | Description |
| ---------- | ------------------------------ | ---------- | ----------------------- |
| `item` | GraphQL `[listKey]UpdateInput` | (required) | The item to be updated. |

### `updateItems`
Expand Down Expand Up @@ -334,8 +334,8 @@ updateUsers([
[Shared Config Options](#shared-config-options) apply to this function.
| Properties | Type | Default | Description |
| ---------- | -------------------------------- | ---------- | ----------------------------- |
| Properties | Type | Default | Description |
| ---------- | ------------------------------- | ---------- | ----------------------------- |
| `items` | GraphQL `[listKey]sUpdateInput` | (required) | Array of items to be updated. |
### `deleteItem`
Expand Down

0 comments on commit e920dd7

Please sign in to comment.