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

gqall

v0.1.2

Published

A CLI for running a GraphQL query and requesting all fields

Downloads

3

Readme

gqall

A CLI for running a GraphQL query and requesting all fields

License

Overview

A common GraphQL question is how to easily request all fields to be returned -- something like:

query {
  hero {
    *
  }
}

Here's an example of the question, and why no way to do that exists: https://www.prisma.io/forum/t/include-all-fields-of-a-type-in-a-graphql-query/352

During development and testing, however, such functionality would be useful. Imagine, for example, you have a GraphQL mutation to update a complex entity. To test that mutation, you want to grab some data, make some changes, and then call the mutation with the updated data. Even with the code completion of something like GraphiQL, this can be kind of painful to type in your query to get the entire record to update.

That's why I've created gqall, a CLI that lets you specify the GraphQL endpoint and just the name of the query, and it will indeed return all fields. This should ease development and testing your GraphQL mutations!

Installation

$ npm install gqall

Usage

gqall takes two parameters:

  1. The URL of your GraphQL endpoint
  2. The GraphQL query to run (just the name and the parameters -- not the fields to return!)

It then prints to standard out the results of the query, including all the fields that you didn't have to specify.

Examples

These are some working examples, thanks to FakerQL:

$ gqall https://fakerql.com/graphql "allPosts(count:1)"
{
  "allPosts": [
    {
      "id": "cjngkb52m00ta28100t8qvier",
      "title": "Table",
      "body": "Et deleniti animi. Possimus natus vero quisquam omnis deleniti.",
      "published": false,
      "createdAt": "Tue Mar 13 2018 20:21:15 GMT+0000 (UTC)",
      "author": {
        "id": "cjngkb52o00tb28100b0rtxig",
        "firstName": "Anabel",
        "lastName": "Klocko",
        "email": "[email protected]",
        "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/mattlat/128.jpg"
      }
    }
  ]
}
$ gqall https://fakerql.com/graphql 'User(id: "me")'
{
  "User": {
    "id": "me",
    "firstName": "Jeffrey",
    "lastName": "Stroman",
    "email": "[email protected]",
    "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/salvafc/128.jpg"
  }
}

You can also pass headers using the -H/--header flag. You can pass multiples.

$ gqall -H "Authorization:Basic ..." https://example.com/graphql 'human(id: "1000")'
{
  ...
}

You can also get help by passing the -h flag.

FAQ

  • How do you pronounce gqall?
    • Unless someone comes up with something better, "JEE - call"

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See CODE_OF_CONDUCT file.

Contributions are welcome! Please open pull requests.

Credits

gqall uses the following open source libraries -- thank you!

License

Copyright © 2018 Rob Warner

Licensed under the MIT License