insomnia-plugin-graphql-query-generator

1.1.4 • Public • Published

insomnia-plugin-graphql-query-generator

Installation

  • Open Insomnia > Preferences > Plugins
  • Type insomnia-plugin-graphql-query-generator and install the plugin.

How To Use

  • Open a workspace and click the workflow actions dropdown
  • Select GraphQL Query Generator: Settings to manage headers for the schema query and default headers for GraphQL operations

    Headers are entered in JSON format eg. {"headerName": "headerValue", "anotherHeaderName": "anotherHeaderValue"} Insomnia environment variables can be used in the default headers, e.g. {"headerName": "{{_.envVarName}}"}

  • Select GraphQL Query Generator: From URL to import GraphQL operations via URL
    • In the Import URL field, you must supply the full URL of the GraphQL api you are trying to import from e.g. http://mygraphqlserver.net/graphql
    • In the Folder Name field, supply the base folder name that will be used (will be appended with '_queries', '_mutations' etc.)
    • In the Generated Request Base URL field, supply the base URL for generated operations

      Environment variables can be used here, e.g. {{_.myBaseUrl}}

Credits

GraphQL generation largely borrowed and modified from James Gatz's graphql codegen plugin github

Package Sidebar

Install

npm i insomnia-plugin-graphql-query-generator

Weekly Downloads

257

Version

1.1.4

License

MIT

Unpacked Size

60 kB

Total Files

22

Last publish

Collaborators

  • monauralswing