This example demonstrates how to programmatically import assets from a URL using the Asset Upload endpoint. Uses Bee-Queue to process jobs (recommended for large data imports).
Included is an example JSON file (assets.json
).
npx degit hygraph/hygraph-examples/using-asset-upload using-asset-upload
Add .env:
cp .env.sample .env
Provide values for HYGRAPH_TOKEN
and HYGRAPH_ENDPOINT
keys.
Install & Run:
cd using-asset-upload
npm install
npm run start assets.json
# or
cd using-asset-upload
yarn
yarn start assets.json