New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql-query-generator

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-query-generator

Generates queries from the GraphQL endpoint via schema introspection.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-71.43%
Maintainers
2
Weekly downloads
 
Created
Source

badge

GraphQL Query Generator

GraphQL Query Generator is a library/tool that helps you easily test your GraphQL endpoints using introspection!

Quick Start

Execute following commands to get this tool running.

NOTE: Whenever there are parameters required you need to provide them in Graphql schema by following our Examples notation. You can find it in Usage section.

npm i -g graphql-query-generator
gql-test http://<your-server-address>:<your-server-port>
gql-test --help # for more information

Usage

First, annotate your queries:

type Query {
  # RollDice has four examples
  #
  # Examples:
  # rollDice(numDice: 4, numSides: 2)
  # rollDice( numDice : 40 , numSides:2)
  # rollDice ( numDice: 2, numSides: 299 )
  # rollDice (
  #   numDice:4,
  #   numSides: 2342
  # )
  rollDice(numDice: Int!, numSides: Int): RandomDie
}

adding +NOFOLLOW in examples will prevent this path from being followed when creating queries

type RandomDie {
  numSides: Int!
  rollOnce: Int!
  statistics(page: Int!): RandomnessStatistics!
  
  # A description for ignored field with parameters
  #
  # Examples:
  # ignoredWithExamples(parameter: 42)
  # +NOFOLLOW
  ignoredWithExamples(parameter: Int!): IgnoredSubtype

  # +NOFOLLOW
  ignoredNoParameters: Ig noredSubtype
}

Afterwards, either:

  1. Use the CLI tool as noted in the quick-start
  2. Install the library and generate your own tests

Contributing

Please submit PR's and create issues... lol... don't break shit. We have little tests so yeah and code is a mess, but deal with it. It works on my machine.

FAQs

Package last updated on 02 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc