1.0.7 • Published 1 year ago

gatsby-plugin-strapi-datas-mocker v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

gatsby-plugin-strapi-datas-mocker is a complementary plugin to the Strapinova-datas-mocker.

nova-datas-mocker takes care of mocking, on demand via a simple switch, all specified Strapi APIs and gatsby-plugin-strapi-datas-mocker drives the gatsby-plugin-schema-snapshot plugin to generate/update the Gatsby schema.

With these two plugins, you will stop wasting time maintaining the shema or the gatsby-node.js of Gatsby and you will have the certainty of no more GraphQL errors.

warn:

  • Need "nova-datas-mocker": "^1.3.10" in Strapi.
  • Need "gatsby-plugin-schema-snapshot": "^3.24.0" in Gatsby (must be added by peerDepencies).

Installation

npm i gatsby-plugin-strapi-datas-mocker
or
yarn add gatsby-plugin-strapi-datas-mocker

Configuration

add this to your gatsby-config.js file

plugins: [
  // ...
  {
    resolve: `gatsby-plugin-strapi-datas-mocker`,
    options: {
      strapiURL: `strapiURL`, // required
      // gatsbyPluginSchemaSnapshotOptions is required, could be {}
      gatsbyPluginSchemaSnapshotOptions: {
        path: `schema.gql`,
        exclude: {
          plugins: [],
        },
      },
    },
  },
  // ...
]
propertyfunctiondefault value
strapiURLStrapi URL, with port, without trailling slachrequired, no default value
forceUpdateForce the plugin to update Schema, without using the switch on Strapi, settings not recommandedfalse
gatsbyPluginSchemaSnapshotOptionsThe configuration of the plugin gatsby-plugin-schema-snapshotrequired, use {}

WARN

forceUpdate in Gatsby will not activate mocking in Strapi!


1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago