Skip to content
Discussion options

You must be logged in to vote

Hey Richard,

So here's the complicated part about this: validation functions are run in both the Admin panel and the server, by design. That means there's no such thing as the Local API within a validator function. That said, could you use fetch to access your REST or GraphQL API?

Payload uses isomorphic-fetch in the background so a simple fetch call will be 100% supported in both browser and server.

Looking forward to hearing your thoughts!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@jmikrut
Comment options

@DanRibbens
Comment options

@richardvanbergen
Comment options

Answer selected by zubricks
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants