While developing it's often useful to be able to have fake data available in the database. Fake data can help with building the UI and save you time when trying to get the GraphQL query correct. GraphJin has the ability do this for you. All you have to do is write a seed script
db:seed command line option. Below is an example of kind of things you can do in a seed script.
Since all mutations and queries are in standard GraphQL you can use all the features available in GraphJin GraphQL.
Another example highlighting how the
connect syntax of GraphJin GraphQL can be used to connect inserted posts to random users that were previously created.
This feature uses the
COPY functionality available in Postgres this is the best way to
insert a large number of rows into a table. The
import_csv function reads in a CSV file using the first
line of the file as column names.