Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @keystone-alpha/keystone with all npm packages installed. Try it out:

var keystone = require("@keystone-alpha/keystone")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@keystone-alpha/keystone v16.0.1

The main @keystone-alpha class & CLI. This is where the magic happens.

keystone

Constructor

Usage

const { Keystone } = require('@keystone-alpha/keystone');

const keystone = new Keystone({
  /*...config */
});

Config

OptionTypeDefaultDescription
nameStringnullThe name of the project. Appears in the Admin UI.
adapterObjectRequiredThe database storage adapter. See the Adapter Framework page for more details.
adaptersArray[]
defaultAdapterObjectnull
adapterConnectOptionsObject{}
defaultAccessObject{}
onConnectFunctionnull
cookieSecretStringqwerty
cookieMaxAgeInt30 days
secureCookiesBooleanVariableDefaults to true in production mode, false otherwise.
sessionStoreObjectnull
schemaNamesArray[public]
queryLimitsObject{}Configures global query limits

queryLimits

Configures global query limits.

These should be used together with list query limits.

Usage

const keystone = new Keystone({
  /* ...config */
  queryLimits: {
    maxTotalResults: 1000,
  },
});
  • maxTotalResults: limit of the total results of all relationship subqueries

Note that maxTotalResults applies to the total results of all relationship queries separately, even if some are nested inside others.

Methods

MethodDescription
createListAdd a list to the Keystone schema.
extendGraphQLSchemaExtend keystones generated schema with custom types, queries, and mutations.
connectManually connect to Adapters.
prepareManually prepare Keystone middlewares.
createItemsAdd items to a Keystone list.
disconnectDisconnect from all adapters.
executeQueryRun GraphQL queries and mutations directly against a Keystone instance.
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free