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

eros_gql

v1.2.8

Published

Documentation generator from a graphql file

Downloads

122

Readme

npm version

Eros_gql


This project generate a doc for a GraphQL API created with Nest.js.

Do not support schema with directives, subscriptions, comments and union type for the moment.

Use

How to

Install the package.

npm i eros_gql

In your package.json script add a script "eros": "eros_gql".

Add a conf file named eros.conf.json (example below).

Running the script will generate a file eros.data.json that save all generated value, you can edit the file to change the value generated in your documentation.

Run your script.

npm run eros

Example eros.conf.json:

{
  "input": "./gqlschema.gql",
  "output": {
    "path": "./genDoc/",
    "dirName": "api"
  },
  "maxDepth": 2,
  "app": {
    "title": "app Title",
    "description": "app description"
  },
  "tree": {
    "user": [
      {
        "requestName": "users",
        "errors": [
          {
            "name": "NOT_FOUND",
            "reason": "User not found"
          }
        ]
      },
      {
        "requestName": "createUser"
      }
    ],
    "post": [
      {
        "requestName": "posts"
      },
      {
        "requestName": "createPost"
      }
    ]
  },
  "scalars":[
    {
      "name": "TextField",
      "regex": "^[a-zA-Z0-9-/'.@ çàèéùâêîôûäëïöü]*$"
    },
    {
      "name": "CustomID",
      "regex": "^[a-zA-Z0-9-/'.@ çàèéùâêîôûäëïöü]*$"
    }
  ]
}

Conf documentation

1. Script conf

  • input is the path to your graphl schema.

  • output have two properties.

    • path the path where the documentation will be generated.
    • dirName the name of the directory that will contain all the genrated files.
  • maxDepth used to avoid infinite loop.

2. Defining your documentation:

app

Your app information.

  • title is the app's title.

  • desciption is the app's description , optionable.

tree

Your documentation structure.

Each property is a folder with a list of request's name from your gql schema.

Here user will be a folder containing the request users.

Each request need a requestName property and can have a list of errors.

Request specified in a folder will be listed under the folder name in the table of content.

scalars

Specify your custom scalars.

An array of object with properties name and regex.

Only support regex for now.

The specified scalars will appear in the table of content.