Skip to content

Executing hooks on existing collections. #229

Answered by jmikrut
richardvanbergen asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @richardvanbergen — I have the perfect solution for you!

You can boot Payload in local mode, which is perfect for running seed scripts, migrations, and more. There is an example of how to do this here:

https://github.com/payloadcms/nextjs-custom-server/blob/master/seed/index.js

Locally booted Payload completely dodges all HTTP activity like opening the REST and GraphQL APIs, and you can use the Local API to do whatever you want (including resaving all of your images so their hooks run.)

Would this help?

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Ontopic
Comment options

@jmikrut
Comment options

@richardvanbergen
Comment options

@jmikrut
Comment options

@richardvanbergen
Comment options

Answer selected by richardvanbergen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants