npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-gql-generator

v1.2.1

Published

Serverless Framework Plugin to help generate GraphQL requests

Downloads

12

Readme

serverless-gql-generator

🚀 What is it?

serverless-gql-generator is here to revolutionize your GraphQL development process! It brings seamless automation to the table, offering:

Automatic GraphQL Request Generation:

Every deploy triggers automatic GraphQL request generation, ensuring your API requests are always up-to-date.

📂 Export to .graphql Files and Postman Collections:

Easily export generated requests as raw .graphql files and/or Postman collections. It's all about simplifying your workflow!

🪣 Upload the generated files to S3:

Easily upload all generated files to the desired S3 Buckets. Making it easier to share the files with your team!

🔐 Automatic URL & API Key Retrieval:

No more manual hassle! serverless-gql-generator automatically fetches URL and API keys, streamlining your integration process.

🔄 Inline Input or .variables.json:

Choose your preferred way to generate requests - whether with inline input or through a handy .variables.json file.

Why should you care?

Say goodbye to the tedious manual work of keeping your GraphQL requests in sync. With serverless-gql-generator, focus on building incredible applications while your GraphQL requests stay effortlessly up-to-date.

🛠️ How to get started:

1. Install and add the dependency to your project

Use the following command to install the plugin and save as a devDependency in your project:

npm install -D serverless-gql-generator

2. Add the Plugin

Add the plugin under the plugins list in your serverless.yml file

service: my-app

plugins:
  - serverless-gql-generator

3. (Optional) Override defaults

If required, one can override the defaults by adding any of the following configuration attributes:

gql-generator:
  schema:
    path: ./schema.graphql # Overrides default schema path 
    encoding: utf-8
    assumeValidSDL: true
  output:
    directory: ./output # Output directory
    s3: # Enables Upload to AWS S3
      bucketName: gql-output-bucket # Mandatory Bucket name
      folderPath: s3folder/path # Override Folder Path inside s3, defaults to `${service}/${stage}`
      skipLocalSaving: false # if the files should also be saved locally or not
    useVariables: true # use variables or have the input inline
    maxDepth: 10 # max depth for schema recursion
    rawRequests: false # set to true to generate raw requests
    postman:
      collectionName: test-name # Overrides colection name, defaults to `${service}-${stage}`
      url: https://test.com/graphql # Overrides url for postman collection
      apiKey: abc-123 # Overrides default API Key if any

4. Trigger the Request Generation

Automatic trigger

The Request generation will be triggered automatically on every deployment.

Manual - CLI trigger

Additionally, developers can also use the following commands to manually trigger the following tasks

Schema Validation

Use the following CLI command to validate your GraphQL schema:

serverless gql-generator validate-schema

Requests generation

Use the following CLI command to trigger the Request generation without redeploying your current service:

serverless gql-generator generate