-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: add Payload SDK package #9463
base: main
Are you sure you want to change the base?
Conversation
Can't wait for this. By the way you've got a typo at |
Any reason we couldn't use this for all test suites that use the REST client? |
We could and I thought about this. And actually the same can be in e2e's, we have a custom SDK there but untyped Just thinking it could be as another |
5bad58c
to
86da15a
Compare
Exposes `pagination: false` to REST / GraphQL to improve performance on large collections by avoiding count query. This will also be nice for our SDK #9463 to have the same properties.
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.
What we are calling SDK is really a REST Client. I wonder if we should consider alternate names.
103dfe1
to
c24ab39
Compare
I think we want to use the same package for the realtime API client. |
c24ab39
to
606e7b2
Compare
Adds Payload SDK package, which can be used to query Payload REST API in a fully type safe way. Has support for all necessary operations, including auth, type safe
select
,populate
,joins
properties and simplified file uploading.Its interface is very similar to the Local API, can't even notice the difference:
Example:
Every operation has optional 3rd parameter which is used to add additional data to the RequestInit object (like headers):
To query custom endpoints, you can use the
request
method, which is used internally for all other methods:Custom
fetch
implementation andbaseInit
for sharedRequestInit
properties: