I have retrieve datas from an API (https://anilist.gitbook.io/anilist-apiv2-docs/). I wanted to know if it was possible to seed the datas that I have retrieved to a database as PostgreSQL, maybe through an ORM but I don't figure how. And if you have the answer and willing to guide me I'll appreciate.
Here is how I retrieved the datas:
import { useQuery, gql } from "@apollo/client";
import { QUERY } from "../graphql/schema";
export default function AnimList() {
const { data, loading, error } = useQuery(QUERY);
if (loading) {
return <h2>Loading...</h2>;
}
if (error) {
console.error(error);
return null;
}
const medias = data.Page.media;
return (
<div className="mainGrid">
<h1>Hello World</h1>
{medias.map((value) => {
return (
<div key={value.id} className="card">
<img src={value.coverImage.medium} alt="placeholder" />
<p>{value.title.userPreferred} </p>
</div>
)
})}
</div>
);
}