This example demonstrates how to reuse lists, fields, hooks and other functions. Navigatingn the types of these primitives can be difficult without experience, so hopefully this project helps you understand how you can apply this to your project.
Reuse is not encouraged typically, but it can be helpful in projects that have grown beyond having everything inline.
To run this project, clone the Keystone repository locally, run pnpm install
at the root of the repository then navigate to this directory and run:
pnpm dev
This will start Keystone’s Admin UI at localhost:3000, where you can add items to an empty database.
When NODE_ENV
is not equal to production
, by default you can play with the GraphQL Playground at localhost:3000/api/graphql.
You can play with this example online in a web browser using the free codesandbox.io service. To launch this example, open the URL https://githubbox.com/keystonejs/keystone/tree/main/examples/reuse. You can also fork this sandbox to make your own changes.