Need private packages and team management tools?Check out npm Teams »

@wheelroom/wheelroom-plugin-graphql

3.1.2 • Public • Published

@wheelroom/wheelroom-plugin-graphql

This is a plugin for the @wheelroom/wheelroom package.

Have a look at the boilerplate to so see how to use this.

Commands

This plugin adds the create-graphql command which lets you create boilerplate graphql. Intended use is generating files for Gatsbyjs, a static site generator.

wheelroom create-graphql <template-set> <path> [options]

Config

The plugin is configured by adding it to wheelroom-config.js

var templateSets = require('./wheelroom-template-sets')
 
module.exports = {
  components: {
      ...
  },
  plugins: [
    {
      resolve: '@wheelroom/wheelroom-plugin-graphql',
      options: {
        templateSets: templateSets,
      },
    },
  ],
}

Template sets

Using typescript, template sets are defined like this.

import { TemplateSets } from '@wheelroom/wheelroom-plugin-graphql'
import { fragment } from './fragment'
import { query } from './query'
 
export const templateSets: TemplateSets = {
  gatsbyjs: {
    fragment: {
      filterComponentSetting: 'asFragment',
      path: '%component-name%-fragment.js',
      template: fragment,
    },
    query: {
      filterComponentSetting: 'asQuery',
      path: '%component-name%-query.js',
      template: query,
    },
  },
}

Install

npm i @wheelroom/wheelroom-plugin-graphql

DownloadsWeekly Downloads

15

Version

3.1.2

License

MIT

Unpacked Size

79.4 kB

Total Files

76

Last publish

Collaborators

  • avatar
  • avatar