diff --git a/api-tests/access-control/authed.test.js b/api-tests/access-control/authed.test.js index c768976f71d..e078ee3c209 100644 --- a/api-tests/access-control/authed.test.js +++ b/api-tests/access-control/authed.test.js @@ -47,10 +47,10 @@ multiAdapterRunners().map(({ before, after, adapterName }) => items = {}; const context = keystone.createContext({ schemaName: 'internal' }); - for (const [listName, _items] of Object.entries(initialData)) { - items[listName] = await createItems({ + for (const [listKey, _items] of Object.entries(initialData)) { + items[listKey] = await createItems({ keystone, - listName, + listKey, items: _items.map(x => ({ data: x })), returnFields: 'id, name', context, diff --git a/api-tests/auth-header.test.js b/api-tests/auth-header.test.js index 19080ca466a..6c06b59b795 100644 --- a/api-tests/auth-header.test.js +++ b/api-tests/auth-header.test.js @@ -92,8 +92,8 @@ multiAdapterRunners().map(({ runner, adapterName }) => runner(setupKeystone, async ({ keystone, app }) => { // seed the db const context = keystone.createContext({ schemaName, skipAccessControl: true }); - for (const [listName, items] of Object.entries(initialData)) { - await createItems({ keystone, listName, items, context }); + for (const [listKey, items] of Object.entries(initialData)) { + await createItems({ keystone, listKey, items, context }); } const { data, errors } = await networkedGraphqlRequest({ app, @@ -109,8 +109,8 @@ multiAdapterRunners().map(({ runner, adapterName }) => 'Allows access with bearer token', runner(setupKeystone, async ({ keystone, app }) => { const context = keystone.createContext({ schemaName, skipAccessControl: true }); - for (const [listName, items] of Object.entries(initialData)) { - await createItems({ keystone, listName, items, context }); + for (const [listKey, items] of Object.entries(initialData)) { + await createItems({ keystone, listKey, items, context }); } const { token } = await login( app, @@ -137,8 +137,8 @@ multiAdapterRunners().map(({ runner, adapterName }) => 'Allows access with cookie', runner(setupKeystone, async ({ keystone, app }) => { const context = keystone.createContext({ schemaName, skipAccessControl: true }); - for (const [listName, items] of Object.entries(initialData)) { - await createItems({ keystone, listName, items, context }); + for (const [listKey, items] of Object.entries(initialData)) { + await createItems({ keystone, listKey, items, context }); } const { token } = await login( app, diff --git a/api-tests/fields.test.js b/api-tests/fields.test.js index ec7624d311a..e7d3c46e4ac 100644 --- a/api-tests/fields.test.js +++ b/api-tests/fields.test.js @@ -12,7 +12,7 @@ describe('Fields', () => { multiAdapterRunners().map(({ runner, adapterName }) => describe(`${adapterName} adapter`, () => { testModules.map(require).forEach(mod => { - const listName = 'test'; + const listKey = 'test'; const keystoneTestWrapper = (testFn = () => {}) => runner( () => { @@ -20,7 +20,7 @@ describe('Fields', () => { // Create a list with all the fields required for testing const fields = mod.getTestFields(); - keystone.createList(listName, { fields }); + keystone.createList(listKey, { fields }); }; return setupServer({ adapterName, createLists }); }, @@ -29,11 +29,11 @@ describe('Fields', () => { const context = keystone.createContext({ schemaName: 'testing' }); await createItems({ keystone, - listName, + listKey, items: mod.initItems().map(x => ({ data: x })), context, }); - return testFn({ keystone, listName, adapterName, ...rest }); + return testFn({ keystone, listKey, adapterName, ...rest }); } ); diff --git a/api-tests/required.test.js b/api-tests/required.test.js index 51a68aefc0d..6c8892b6685 100644 --- a/api-tests/required.test.js +++ b/api-tests/required.test.js @@ -11,7 +11,7 @@ describe('Test isRequired flag for all field types', () => { testModules.map(require).forEach(mod => { describe(`Test isRequired flag for module: ${mod.name}`, () => { const type = mod.type; - const listName = 'Test'; + const listKey = 'Test'; const keystoneTestWrapper = (testFn = () => {}) => runner( () => @@ -19,7 +19,7 @@ describe('Test isRequired flag for all field types', () => { adapterName, createLists: keystone => { if (type.type === 'Select') { - keystone.createList(listName, { + keystone.createList(listKey, { fields: { name: { type: Text }, testField: { @@ -33,7 +33,7 @@ describe('Test isRequired flag for all field types', () => { }, }); } else { - keystone.createList(listName, { + keystone.createList(listKey, { fields: { name: { type: Text }, testField: { type, isRequired: true }, diff --git a/demo-projects/blog/index.js b/demo-projects/blog/index.js index 9bb437dd4c1..5ee3ed1702d 100644 --- a/demo-projects/blog/index.js +++ b/demo-projects/blog/index.js @@ -19,7 +19,7 @@ const keystone = new Keystone({ const users = await keystone.lists.User.adapter.findAll(); if (!users.length) { const initialData = require('./initialData'); - await createItems({ keystone, listName: 'User', items: initialData.User }); + await createItems({ keystone, listKey: 'User', items: initialData.User }); } }, }); diff --git a/demo-projects/meetup/initialData.js b/demo-projects/meetup/initialData.js index 0e6243a4cb0..1609d9bcd81 100644 --- a/demo-projects/meetup/initialData.js +++ b/demo-projects/meetup/initialData.js @@ -39,9 +39,9 @@ async function seedData(intitialData, keystone) { * 2. Insert the data with the required relationships using connect */ - const { createUsers: users } = await createItems({ + const users = await createItems({ keystone, - listName: 'User', + listKey: 'User', items: initialData['User'].map(x => ({ data: x })), // name field is required for connect query for setting up Organiser list returnFields: 'id, name', @@ -49,7 +49,7 @@ async function seedData(intitialData, keystone) { await Promise.all( ['Event', 'Talk', 'Rsvp', 'Sponsor'].map(list => - createItems({ keystone, listName: list, items: intitialData[list].map(x => ({ data: x })) }) + createItems({ keystone, listKey: list, items: intitialData[list].map(x => ({ data: x })) }) ) ); @@ -59,7 +59,7 @@ async function seedData(intitialData, keystone) { .map(createOrganisers(users)); // Run the GraphQL query to insert all the organisers - await createItems({ keystone, listName: 'Organiser', items: organisers }); + await createItems({ keystone, listKey: 'Organiser', items: organisers }); } function createOrganisers(users) { diff --git a/packages/server-side-graphql-client/README.md b/packages/server-side-graphql-client/README.md index fae69e7700e..5de1becce04 100644 --- a/packages/server-side-graphql-client/README.md +++ b/packages/server-side-graphql-client/README.md @@ -29,7 +29,7 @@ const { createItem } = require('@keystonejs/server-side-graphql-client'); const user = await createItem({ keystone, - listName: 'User', + listKey: 'User', item: { name: 'Alice' }, returnFields: `id name`, }); @@ -47,7 +47,7 @@ These utilities can be used for a wide range of specific use-cases, some more co ```js const seedUsers = async usersData => { - await createItems({ keystone, listName: 'User', items: usersData }); + await createItems({ keystone, listKey: 'User', items: usersData }); }; ``` @@ -67,7 +67,7 @@ keystone.createList('Page', { const pageToCopy = resolvedData.copy ? await getItem({ keystone, - listName: 'Page', + listKey: 'Page', itemId: resolvedData.copy, returnFields: 'name, content', }) @@ -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. | -| `listName` | `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. | @@ -124,7 +124,7 @@ keystone.createList('User', { const addUser = async userInput => { const user = await createItem({ keystone, - listName: 'User', + listKey: 'User', item: userInput, returnFields: `name, email`, }); @@ -140,7 +140,7 @@ addUser({ name: 'keystone user', email: 'keystone@test.com' }); | Properties | Type | Default | Description | | ---------- | ------------------------------- | ---------- | ----------------------- | -| `item` | GraphQL `[listName]CreateInput` | (required) | The item to be created. | +| `item` | GraphQL `[listKey]CreateInput` | (required) | The item to be created. | ### `createItems` @@ -168,7 +168,7 @@ const dummyUsers = [ const addUsers = async () => { const users = await createItems({ keystone, - listName: 'User', + listKey: 'User', items: dummyUsers, returnFields: `name`, }); @@ -183,7 +183,7 @@ addUsers(); | Properties | Type | Default | Description | | ---------- | -------------------------------- | ---------- | ---------------------------------------------------------------------------------------------- | -| `items` | GraphQL `[listName]sCreateInput` | (required) | The array of objects to be created. | +| `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. | ### `getItem` @@ -205,7 +205,7 @@ keystone.createList('User', { const getUser = async ({ itemId }) => { const user = await getItem({ keystone, - listName: 'User', + listKey: 'User', itemId, returnFields: 'id, name', }); @@ -239,10 +239,10 @@ keystone.createList('User', { }); const getUsers = async () => { - const allUsers = await getItems({ keystone, listName: 'User', returnFields: 'name' }); + const allUsers = await getItems({ keystone, listKey: 'User', returnFields: 'name' }); const someUsers = await getItems({ keystone, - listName: 'User', + listKey: 'User', returnFields: 'name', where: { name: 'user1' }, }); @@ -258,7 +258,7 @@ getUsers(); | Properties | Type | Default | Description | | ---------- | ------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------- | -| `where` | GraphQL `[listName]WhereInput` | `{}` | Limit results to items matching [where clause](https://www.keystonejs.com/guides/intro-to-graphql/#where). | +| `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. | ### `updateItem` @@ -280,7 +280,7 @@ keystone.createList('User', { const updateUser = async updateUser => { const updatedUser = await updateItem({ keystone, - listName: 'User', + listKey: 'User', item: updateUser, returnFields: 'name', }); @@ -295,7 +295,7 @@ updateUser({ id: '123', data: { name: 'newName' } }); | Properties | Type | Default | Description | | ---------- | ------------------------------- | ---------- | ----------------------- | -| `item` | GraphQL `[listName]UpdateInput` | (required) | The item to be updated. | +| `item` | GraphQL `[listKey]UpdateInput` | (required) | The item to be updated. | ### `updateItems` @@ -316,7 +316,7 @@ keystone.createList('User', { const updateUsers = async (updateUsers) => { const users = await updateItems({ keystone, - listName: 'User', + listKey: 'User', items: updateUsers, returnFields: 'name' }); @@ -336,7 +336,7 @@ updateUsers([ | Properties | Type | Default | Description | | ---------- | -------------------------------- | ---------- | ----------------------------- | -| `items` | GraphQL `[listName]sUpdateInput` | (required) | Array of items to be updated. | +| `items` | GraphQL `[listKey]sUpdateInput` | (required) | Array of items to be updated. | ### `deleteItem` @@ -355,7 +355,7 @@ keystone.createList('User', { }); const deleteUser = async itemId => { - const user = await deleteItem({ keystone, listName: 'User', itemId }); + const user = await deleteItem({ keystone, listKey: 'User', itemId }); console.log(user); // { id: '123' } }; deleteUser('123'); @@ -386,7 +386,7 @@ keystone.createList('User', { }); const deletedUsers = async items => { - const users = await deleteItems({ keystone, listName: 'User', items }); + const users = await deleteItems({ keystone, listKey: 'User', items }); console.log(users); // [{id: '123'}, {id: '456'}] }; deletedUsers(['123', '456']); diff --git a/packages/server-side-graphql-client/lib/server-side-graphql-client.js b/packages/server-side-graphql-client/lib/server-side-graphql-client.js index 32b130a78f1..f10cc5c4865 100644 --- a/packages/server-side-graphql-client/lib/server-side-graphql-client.js +++ b/packages/server-side-graphql-client/lib/server-side-graphql-client.js @@ -38,8 +38,8 @@ const _runChunkedMutation = async ({ keystone, query, gqlName, pageSize, items, return [].concat(...result.map(item => item[gqlName])); }; -const createItem = async ({ keystone, listName, item, returnFields = `id`, context }) => { - const { createMutationName, createInputName } = keystone.lists[listName].gqlNames; +const createItem = async ({ keystone, listKey, item, returnFields = `id`, context }) => { + const { createMutationName, createInputName } = keystone.lists[listKey].gqlNames; const query = `mutation ($item: ${createInputName}){ ${createMutationName}(data: $item) { ${returnFields} } @@ -51,13 +51,13 @@ const createItem = async ({ keystone, listName, item, returnFields = `id`, conte const createItems = async ({ keystone, - listName, + listKey, items, pageSize = 500, returnFields = `id`, context, }) => { - const { createManyMutationName, createManyInputName } = keystone.lists[listName].gqlNames; + const { createManyMutationName, createManyInputName } = keystone.lists[listKey].gqlNames; const query = `mutation ($items: [${createManyInputName}]){ ${createManyMutationName}(data: $items) { ${returnFields} } @@ -73,8 +73,8 @@ const createItems = async ({ }); }; -const getItem = async ({ keystone, listName, itemId, returnFields = `id`, context }) => { - const { itemQueryName } = keystone.lists[listName].gqlNames; +const getItem = async ({ keystone, listKey, itemId, returnFields = `id`, context }) => { + const { itemQueryName } = keystone.lists[listKey].gqlNames; const query = `query ($id: ID!) { ${itemQueryName}(where: { id: $id }) { ${returnFields} } }`; const result = await runQuery({ keystone, query, variables: { id: itemId }, context }); @@ -83,13 +83,13 @@ const getItem = async ({ keystone, listName, itemId, returnFields = `id`, contex const getItems = async ({ keystone, - listName, + listKey, where = {}, pageSize = 500, returnFields = `id`, context, }) => { - const { listQueryName, whereInputName } = keystone.lists[listName].gqlNames; + const { listQueryName, whereInputName } = keystone.lists[listKey].gqlNames; const query = `query ($first: Int!, $skip: Int!, $where: ${whereInputName}) { ${listQueryName}(first: $first, skip: $skip, where: $where) { ${returnFields} } }`; let skip = 0; @@ -114,8 +114,8 @@ const getItems = async ({ return allItems; }; -const updateItem = async ({ keystone, listName, item, returnFields = `id`, context }) => { - const { updateMutationName, updateInputName } = keystone.lists[listName].gqlNames; +const updateItem = async ({ keystone, listKey, item, returnFields = `id`, context }) => { + const { updateMutationName, updateInputName } = keystone.lists[listKey].gqlNames; const query = `mutation ($id: ID!, $data: ${updateInputName}){ ${updateMutationName}(id: $id, data: $data) { ${returnFields} } @@ -133,13 +133,13 @@ const updateItem = async ({ keystone, listName, item, returnFields = `id`, conte const updateItems = async ({ keystone, - listName, + listKey, items, pageSize = 500, returnFields = `id`, context, }) => { - const { updateManyMutationName, updateManyInputName } = keystone.lists[listName].gqlNames; + const { updateManyMutationName, updateManyInputName } = keystone.lists[listKey].gqlNames; const query = `mutation ($items: [${updateManyInputName}]){ ${updateManyMutationName}(data: $items) { ${returnFields} } @@ -154,8 +154,8 @@ const updateItems = async ({ }); }; -const deleteItem = async ({ keystone, listName, itemId, returnFields = `id`, context }) => { - const { deleteMutationName } = keystone.lists[listName].gqlNames; +const deleteItem = async ({ keystone, listKey, itemId, returnFields = `id`, context }) => { + const { deleteMutationName } = keystone.lists[listKey].gqlNames; const query = `mutation ($id: ID!){ ${deleteMutationName}(id: $id) { ${returnFields} } @@ -167,13 +167,13 @@ const deleteItem = async ({ keystone, listName, itemId, returnFields = `id`, con const deleteItems = async ({ keystone, - listName, + listKey, items, pageSize = 500, returnFields = `id`, context, }) => { - const { deleteManyMutationName } = keystone.lists[listName].gqlNames; + const { deleteManyMutationName } = keystone.lists[listKey].gqlNames; const query = `mutation ($items: [ID!]){ ${deleteManyMutationName}(ids: $items) { diff --git a/packages/server-side-graphql-client/tests/index.test.js b/packages/server-side-graphql-client/tests/index.test.js index ce37b2ac180..49a73878dae 100644 --- a/packages/server-side-graphql-client/tests/index.test.js +++ b/packages/server-side-graphql-client/tests/index.test.js @@ -18,7 +18,7 @@ const schemaName = 'testing'; const seedDb = ({ keystone }) => createItems({ keystone, - listName: 'Test', + listKey: 'Test', items: testData, context: keystone.createContext({ schemaName }), }); @@ -46,7 +46,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Seed the db const item = await createItem({ keystone, - listName: 'Test', + listKey: 'Test', item: testData[0].data, context: keystone.createContext({ schemaName }), }); @@ -55,7 +55,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Get single item from db const singleItem = await getItem({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name, age', itemId: item.id, context: keystone.createContext({ schemaName }), @@ -70,14 +70,14 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Seed the db await createItems({ keystone, - listName: 'Test', + listKey: 'Test', items: testData, context: keystone.createContext({ schemaName }), }); // Get all the items back from db const allItems = await getItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name, age', context: keystone.createContext({ schemaName }), }); @@ -95,7 +95,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Update a single item const item = await updateItem({ keystone, - listName: 'Test', + listKey: 'Test', item: { id: seedItems[0].id, data: { name: 'updateTest' } }, returnFields: 'name, age', context: keystone.createContext({ schemaName }), @@ -112,7 +112,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Update multiple items const items = await updateItems({ keystone, - listName: 'Test', + listKey: 'Test', items: seedItems.map((item, i) => ({ id: item.id, data: { name: `update-${i}` } })), returnFields: 'name, age', context: keystone.createContext({ schemaName }), @@ -134,7 +134,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Delete a single item await deleteItem({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name age', itemId: items[0].id, context: keystone.createContext({ schemaName }), @@ -143,7 +143,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Retrieve items const allItems = await getItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name, age', context: keystone.createContext({ schemaName }), }); @@ -159,7 +159,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Delete multiple items const deletedItems = await deleteItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name age', items: items.map(item => item.id), context: keystone.createContext({ schemaName }), @@ -170,7 +170,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => // Get all the items back from db const allItems = await getItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name, age', context: keystone.createContext({ schemaName }), }); @@ -187,7 +187,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => await seedDb({ keystone }); const allItems = await getItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name, age', context: keystone.createContext({ schemaName }), }); @@ -202,7 +202,7 @@ multiAdapterRunners().map(({ runner, adapterName }) => await seedDb({ keystone }); const allItems = await getItems({ keystone, - listName: 'Test', + listKey: 'Test', returnFields: 'name', where: { name: 'test' }, context: keystone.createContext({ schemaName }), diff --git a/test-projects/access-control/server.js b/test-projects/access-control/server.js index 972da2b2b91..565230ef0aa 100644 --- a/test-projects/access-control/server.js +++ b/test-projects/access-control/server.js @@ -19,8 +19,8 @@ keystone if (!users.length) { await Promise.all(Object.values(keystone.adapters).map(adapter => adapter.dropDatabase())); const context = keystone.createContext({ schemaName: 'internal' }); - for (const [listName, items] of Object.entries(initialData)) { - await createItems({ keystone, listName, items: items.map(x => ({ data: x })), context }); + for (const [listKey, items] of Object.entries(initialData)) { + await createItems({ keystone, listKey, items: items.map(x => ({ data: x })), context }); } } @@ -29,8 +29,8 @@ keystone app.get('/reset-db', async (req, res) => { await Promise.all(Object.values(keystone.adapters).map(adapter => adapter.dropDatabase())); const context = keystone.createContext({ schemaName: 'internal' }); - for (const [listName, items] of Object.entries(initialData)) { - await createItems({ keystone, listName, items: items.map(x => ({ data: x })), context }); + for (const [listKey, items] of Object.entries(initialData)) { + await createItems({ keystone, listKey, items: items.map(x => ({ data: x })), context }); } res.redirect('/admin'); }); diff --git a/test-projects/basic/server.js b/test-projects/basic/server.js index 92fa4d6cce4..e2d071d4cc9 100644 --- a/test-projects/basic/server.js +++ b/test-projects/basic/server.js @@ -18,7 +18,7 @@ keystone const users = await keystone.lists.User.adapter.findAll(); if (!users.length) { await dropAllDatabases(keystone.adapters); - await createItems({ keystone, listName: 'User', items: initialData.User }); + await createItems({ keystone, listKey: 'User', items: initialData.User }); } const app = express(); @@ -54,23 +54,23 @@ function dropAllDatabases(adapters) { * 2. Insert `Post` data, with the required relationships, via `connect` nested mutation. */ async function seedData(initialData) { - const { createUsers: users } = await createItems({ + const users = await createItems({ keystone, - listName: 'User', + listKey: 'User', items: initialData['User'], returnFields: 'id, email', }); - const { createPostCategories: postCategories } = await createItems({ + const postCategories = await createItems({ keystone, - listName: 'PostCategory', + listKey: 'PostCategory', items: initialData['PostCategory'], returnFields: 'id, name', }); await createItems({ keystone, - listName: 'ReadOnlyList', + listKey: 'ReadOnlyList', items: initialData['ReadOnlyList'], returnFields: 'id, name', }); @@ -113,7 +113,7 @@ async function seedData(initialData) { ); // Run the GraphQL query to insert all the post - await createItems({ keystone, listName: 'Post', items: Post }); + await createItems({ keystone, listKey: 'Post', items: Post }); } function createPost(users, postCategories) { diff --git a/test-projects/client-validation/server.js b/test-projects/client-validation/server.js index 5bed61e9e12..34e6c593ecb 100644 --- a/test-projects/client-validation/server.js +++ b/test-projects/client-validation/server.js @@ -51,7 +51,7 @@ function dropAllDatabases(adapters) { async function seedData(initialData) { return createItems({ keystone, - listName: 'User', + listKey: 'User', items: initialData.User.map(x => ({ data: x })), }); } diff --git a/test-projects/login/server.js b/test-projects/login/server.js index 27c145be02b..6f1c9d751ec 100644 --- a/test-projects/login/server.js +++ b/test-projects/login/server.js @@ -47,7 +47,7 @@ function dropAllDatabases(adapters) { async function seedData(initialData) { return createItems({ keystone, - listName: 'User', + listKey: 'User', items: initialData.User.map(x => ({ data: x })), }); } diff --git a/test-projects/social-login/server.js b/test-projects/social-login/server.js index d650cce7da0..030a1514a1e 100644 --- a/test-projects/social-login/server.js +++ b/test-projects/social-login/server.js @@ -207,7 +207,7 @@ keystone }); await createItems({ keystone, - listName: 'User', + listKey: 'User', items: initialData.User.map(x => ({ data: x })), }); } @@ -252,10 +252,10 @@ keystone Object.values(keystone.adapters).forEach(async adapter => { await adapter.dropDatabase(); }); - for (const [listName, _items] of Object.entries(initialData)) { + for (const [listKey, _items] of Object.entries(initialData)) { await createItems({ keystone, - listName, + listKey, items: _items.map(x => ({ data: x })), }); }