Graphqurl v1.0: curl for GraphQL

Graphqurl Demo

Graphqurl is a curl like CLI for GraphQL. Its features include:

  • CLI for making GraphQL queries. It also provisions queries with autocomplete.
  • Run a custom GraphiQL, where you can specify request's headers, locally against any endpoint.
  • Can be used as a library with Node.js or from the browser.
  • Supports subscriptions over websocket.
  • Can export GraphQL schema(s).

What's new in v1.0?

Reduced bundle size

Graphqurl, until v0.3.3, used Apollo client under the hood for making GraphQL queries and subscriptions. This caused the bundle size to explode considerably (142kB).

With v1.0, Graphqurl uses light-weight isomorphic HTTP clients which reduced the bundle size by over 80kB, i.e by a whopping 56%. It is now an  ideal tool for use cases where users wish to make GraphQL queries, mutations and subscriptions without any extra overhead of caching and networking. This is the bundle composition of graphqurl v0.3.3 as compared to graphqurl v1.0.1:

Note that the size of the CLI binary is not considered in the above bundle size distribution. That said, the CLI binary in v1.0.1 has also been optimised and is about 300kB lighter than that of v0.3.3.

Improved GraphiQL

You can run a custom Graphiql in graphqurl. In v1.0 we have extended it to include popular community tools like:

  1. Graphiql Explorer
  2. Graphql Code Exporter

You can also run graphiql on host and port of your choice by using the --graphiqlHost and --graphiqlPort flags on the CLI.

Improved scripting API (breaking)

The parsing of GraphQL queries before execution, has been removed because it is unnecessary for a scripting tool like graphqurl, as most users build GraphQL queries through auto-completion tools like GraphiQL, which highly reduce the possibility of syntax errors. This means, the syntax errors in your GraphQL queries, if any, shall not be caught before the query actually hits the GraphQL server.

If you've been using graphqurl in node scripts and in the browser, the API has changed considerably. The usage of graphqurl as a node library v1.0 onwards involves creating a client followed by executing GraphQL operations, whereas until v0.3.3, you could import a query function and execute it.

Please find the updated API documentation in the README and a sample script in the graphqurl repository.

The complete changelog can be found here for complete list of changes in the latest release.

What next?

Moving forward, we have the following things on the roadmap:

Please let us know what else you'd like to see on the roadmap. We are open to contributions, you can read our contributing guide to help you get started.

20 May, 2021
Subscribe to stay up-to-date on all things Hasura. One newsletter, once a month.
Accelerate development and data access with radically reduced complexity.