What's new in GraphQL CLI 4.1
GraphQL CLI (opens in a new tab) is your one-stop shop for developing full-stack GraphQL applications in Node.js. With GraphQL CLI you can create and run a new GraphQL application in just a few seconds! Just declare your GraphQL schema, and you can perform code generation, schema validation, introspection and more through intuitive CLI commands.
GraphQL CLI aggregates multiple community projects giving developers the best getting started experience. Tools included in the CLI are mature and developed over the years based on Guild's experience in pushing production ready GraphQL solutions and also through collaboration with Red Hat community projects.
This post covers a number of enhancements added in GraphQL CLI 4.1, which will further improve your GraphQL development experience. Check out our previous post GraphQL CLI is back! for a full overview of the library and its features.
All the templates are configured with Graphback (opens in a new tab), for both runtime and generation purposes. Graphback 1.0 has recently been released, check out their blog post Announcing the Release of Graphback 1.0 (opens in a new tab) that goes into deeper details of Graphback's features and capabilities.
To generate your schema and documents with Graphback, run
graphql generate from your application
root. See the generate command docs (opens in a new tab) for a thorough explanation
of this command and usage guides.
The serve command is now powered by graphql-serve (opens in a new tab), letting you start up an in-memory GraphQL server and playground in seconds - perfect for mocking and testing!
$ graphql serve --port 4000 ./model/datamodel.graphql Starting server... Listening at: http://localhost:4000/graphql
Check out the serve command docs (opens in a new tab) for installation and usage guides!
init command is your gateway to creating your new GraphQL application with GraphQL CLI. You
will be guided through some questions and after a few seconds a tailor-made starter application will
There are several improvements to all of our templates to make them cleaner and more production-ready. Additionally, we had added two new starter templates: a plain MongoDB template and a MongoDB template with out-of-the-box data synchronization support.
To start using these templates, use the
We've built a new website to host the GraphQL CLI documentation! Check it out at graphql-cli.com (opens in a new tab).
GraphQL CLI 4.1 has been updated to use the latest versions of GraphQL Code Generator (opens in a new tab) and GraphQL Inspector (opens in a new tab), which are included as recommended, best practice workflows for developing production-ready GraphQL applications.
Start using GraphQL CLI today to create your GraphQL application in just a few steps!
The easiest way to get started is to initialize your new application with npx:
npx graphql-cli init
GraphQL CLI will guide you through some steps and in a few seconds your project will created and ready to use. Happy coding!
As always, we want your feedback! We would love to hear your suggestions and ideas to help make GraphQL CLI even better. Reach out to us through GitHub (opens in a new tab) or join our Discord community server (opens in a new tab).
Join our newsletter
Want to hear from us when there's something new? Sign up and stay up to date!Recent issues of our newsletter
GraphQLConf 2023 Recap
Explore the highlights of GraphQLConf 2023. Learn about the latest trends in GraphQL, from gateway solutions to composite schemas and innovative projects.
State of GraphQL Gateways in 2023
A six-month journey of researching, benchmarking, exploring and comparing GraphQL gateways and the Federation spec in 2023.
Hive Summer Update 2023
Learn what is new on GraphQL Hive, we have shipped a lot of new exciting features and improvements.
The complete GraphQL Scalar Guide
Knowing how native and custom GraphQL Scalar works enables building flexible and extendable GraphQL schema.