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

Add API docs for the list items API #5518

Merged
merged 1 commit into from
Apr 25, 2021
Merged

Add API docs for the list items API #5518

merged 1 commit into from
Apr 25, 2021

Conversation

timleslie
Copy link
Contributor

@timleslie timleslie commented Apr 22, 2021

Adds docs for the lists item API. Preview here: https://keystone-next-docs-git-items-api-docs-keystonejs.vercel.app/apis/list-items

Updates the findMany() and count() functions to have a default arg of {} so that .count() and .findMany() work as expected when no argument is provided.

Updates an arbitrary handful of server-side-graphql-client calls in the tests to use the list items API to verify that the documents can be followed successfully. This is the first set of changes for #5485.

Does not document the DB items API, that will be done separately.

@changeset-bot
Copy link

changeset-bot bot commented Apr 22, 2021

🦋 Changeset detected

Latest commit: b4574b5

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

This PR includes changesets to release 5 packages
Name Type
@keystone-next/keystone Patch
@keystone-next/types Patch
@keystone-next/test-utils-legacy 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 Apr 22, 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/4H8dC44juawSqwsdoQDciG3WKHaz
✅ Preview: https://keystone-next-docs-git-items-api-docs-keystonejs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 22, 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.

Latest deployment of this branch, based on commit b4574b5:

Sandbox Source
@keystone-next/example-sandbox Configuration

@vercel vercel bot temporarily deployed to Preview April 22, 2021 23:48 Inactive
@vercel vercel bot temporarily deployed to Preview April 22, 2021 23:54 Inactive
@vercel vercel bot temporarily deployed to Preview April 23, 2021 00:03 Inactive
@vercel vercel bot temporarily deployed to Preview April 23, 2021 00:08 Inactive
@timleslie timleslie force-pushed the items-api-docs branch 2 times, most recently from 41277da to 66285f4 Compare April 23, 2021 00:10
@vercel vercel bot temporarily deployed to Preview April 23, 2021 00:10 Inactive
@timleslie timleslie changed the title [WIP] Add API docs for the list items API. Add API docs for the list items API. Apr 23, 2021
@timleslie timleslie requested a review from a team April 23, 2021 00:18
@timleslie timleslie changed the title Add API docs for the list items API. Add API docs for the list items API Apr 23, 2021
@timleslie timleslie enabled auto-merge (squash) April 23, 2021 00:18
@vercel vercel bot temporarily deployed to Preview April 23, 2021 04:51 Inactive
@vercel vercel bot temporarily deployed to Preview April 23, 2021 05:02 Inactive
Copy link
Member

@JedWatson JedWatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @timleslie 👏

Not required for this PR (good to publish this immediately imo) but a couple of next steps stood out when I was reading:

  • You're demo'ing the API for relationship creation, I don't think we've actually documented this anywhere else and it's a bit like "oh wait, what's that doing? how do I learn more? what else can I do?" and it would be good to add a link out when there's more docs for that
  • For the create/update mutation APIs, would be nice to add some explanation for what the data argument actually is; this subtly doesn't match the output types people may expect, again I think the API reference for this is missing though and people will probably wonder about that here, it's a bit mysterious
  • We're not explaining anything about how permissions (/ session) interact here. That's kind of covered in the context API docs, but would probably be good to remind readers about here because it's usually going to be related and important to think about when using this API

@timleslie
Copy link
Contributor Author

Great start @timleslie 👏

Not required for this PR (good to publish this immediately imo) but a couple of next steps stood out when I was reading:

  • You're demo'ing the API for relationship creation, I don't think we've actually documented this anywhere else and it's a bit like "oh wait, what's that doing? how do I learn more? what else can I do?" and it would be good to add a link out when there's more docs for that

Yep, that's on my hit list 👍

  • For the create/update mutation APIs, would be nice to add some explanation for what the data argument actually is; this subtly doesn't match the output types people may expect, again I think the API reference for this is missing though and people will probably wonder about that here, it's a bit mysterious

We have rudimentary API docs for the GraphQL operations here: https://next.keystonejs.com/apis/graphql#create-user I might go ahead and link do these docs.

  • We're not explaining anything about how permissions (/ session) interact here. That's kind of covered in the context API docs, but would probably be good to remind readers about here because it's usually going to be related and important to think about when using this API

Yep, will loop back on that once those guides and APIs are more fleshed out 👍

@vercel vercel bot temporarily deployed to Preview April 25, 2021 22:59 Inactive
@timleslie timleslie merged commit fddeacf into master Apr 25, 2021
@timleslie timleslie deleted the items-api-docs branch April 25, 2021 23:04
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.

2 participants