Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow access to Lists fields and other metadata from Backend API #6059

Closed
wants to merge 2 commits into from

Conversation

MurzNN
Copy link
Contributor

@MurzNN MurzNN commented Jul 6, 2021

After Keystone's core was reworked by #5665, we miss the ability to access Lists metadata at backend side.

For example, earlier we can get list of fields from needed List via something like this:

const myListFields = context.lists[listName].fieldsByPath;
const myListAuthorFieldType = context.lists[listName].fieldsByPath['author'].adapter.fieldName; // eg 'Relationship'

This PR is returns ability to get list of fields for all Lists, with all metadata such as field type (kind), access, hooks, views, etc:

const myListAuthorFieldType = context.initialisedLists[listName].fields['author'].dbField.kind; // 'relation'

Please review id and describe if something wrong... Or if this info is already accessible at backend via some API call, please show some examples. Thanks!

@changeset-bot
Copy link

changeset-bot bot commented Jul 6, 2021

🦋 Changeset detected

Latest commit: 9cc7399

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@keystone-next/keystone Minor
@keystone-next/auth Major
@keystone-next/example-testing Patch
@keystone-next/example-with-auth Patch
@keystone-next/example-auth Patch
@keystone-next/examples-app-basic Patch
@keystone-next/example-ecommerce Patch
keystone-next-app Patch
@keystone-next/example-roles Patch
@keystone-next/example-sandbox Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 6, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/DV4G8uokHonV3fxj61bJRccxhj2e
✅ Preview: https://keystone-next-docs-git-fork-murznn-context-li-6ac484-keystonejs.vercel.app

@vercel vercel bot temporarily deployed to Preview July 6, 2021 10:00 Inactive
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@vercel vercel bot temporarily deployed to Preview July 6, 2021 11:13 Inactive
@timleslie
Copy link
Contributor

Implemented in #6403.

@timleslie timleslie closed this Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants