Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 913 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 913 Bytes

gatsby-source-faker

This is a plugin that allows you to use faker.js to generate fake data for gatsby sites. This could come in handy for creating example sites, documentation, or just to experiment with Gatsby.js

To use it

Install gatsby-source-faker

    npm install --save gatsby-source-faker

or

    npm install gatsby-source-faker

Add gatsby-source-faker to the gatsby-config.js as follows

plugins: [
  {
    resolve: `gatsby-source-faker`,
    // derive schema from faker's options
    options: {
      schema: {
        name: ["firstName", "lastName"],
      },
      count: 3, // how many fake objects you need
      type: "NameData", // Name of the graphql query node
    },
  },
];

Example: Using Faker