-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ssgc updates #5667
Ssgc updates #5667
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/14qMzL8y8g2WWfT56w51wFpBzEbB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI, I haven't made all the GraphQL API changes that we discussed so this will need more changing in the future
@@ -119,7 +119,7 @@ const getItems = async ({ | |||
}: { | |||
listKey: string; | |||
where?: Record<string, any> | null; | |||
sortBy?: readonly string[] | null; | |||
orderBy?: readonly Record<string, 'asc' | 'desc'>[] | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't right, the value can be anything, it will often be asc or desc but that is not guaranteed and there are definitely things that will deviate from it (e.g. relations, fields with multiple fields in the db)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, interesting, what's the correct type here then, is it string
, or any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI, I haven't made all the GraphQL API changes that we discussed so this will need more changing in the future
Yep, just want to get this close enough to run for now 👍
packages-next/types/src/utils.ts
Outdated
@@ -9,8 +9,7 @@ export type BaseGeneratedListTypes = { | |||
readonly search?: string | null; | |||
readonly first?: number | null; | |||
readonly skip?: number | null; | |||
readonly orderBy?: string; | |||
readonly sortBy?: ReadonlyArray<string> | null; | |||
readonly orderBy?: ReadonlyArray<Record<string, 'asc' | 'desc'>> | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clicked the wrong button
Update the server-side-graphql-library to use the updated GraphQL APIs, unblocking tests which use this API indirectly via the items API.