gatsby-source-faker

5.13.1 • Public • Published

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.

Installation

npm install gatsby-source-faker

How to use it

Add gatsby-source-faker to the gatsby-config.js as following:

// In your gatsby-config.js
module.exports = {
  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

Package Sidebar

Install

npm i gatsby-source-faker

Weekly Downloads

235

Version

5.13.1

License

MIT

Unpacked Size

34.8 kB

Total Files

7

Last publish

Collaborators

  • kathmbeck
  • pieh
  • tylerbarnes
  • fk
  • daniellewgatsby
  • kylemathews
  • freiksenet
  • dschau
  • wardpeet
  • m-allanson
  • sidharthachatterjee
  • moocar