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

create-graphql-express

v1.1.10

Published

Set up a GraphQL API by running one command.

Downloads

3

Readme

Create React App Build Status PRs Welcome

Create GraphQL APIs with no build configuration.

Create GraphQL API works on macOS, Windows, and Linux. If something doesn’t work, please file an issue. If you have questions or need help, please ask in our Discord community.

Quick Overview

npx create-graphql-express my-api
cd my-api
npm install
npm run dev

If you've previously installed create-graphql-express globally via npm install -g create-graphql-express, we recommend you uninstall the package using npm uninstall -g create-graphql-express to ensure that npx always uses the latest version.

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000/graphql to see GraphpiQL. When you’re ready to deploy to production, create a minified bundle with npm run build.

Get Started Immediately

You don’t need to install or configure tools like Typescript or Eslint. They are preconfigured and hidden so that you can focus on the code.

Create a project, and you’re good to go.

Creating an API

You’ll need to have Node 10.16.0 or later version on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.

To create a new app, you may choose one of the following methods:

npx

npx create-graphql-express my-api

(npx is a package runner tool that comes with npm 5.2+ and higher, see instructions for older npm versions)

my-api
├── jest.config.js
├── package.json
├── src
|  ├── errors.ts
|  ├── generated
|  |  ├── schema.ts
|  |  └── types.d.ts
|  ├── graphql
|  |  ├── calculator
|  |  |  ├── calculateMutation.ts
|  |  |  └── calculator.graphql
|  |  ├── generated
|  |  |  ├── root.graphql
|  |  |  └── rootResolver.ts
|  |  ├── _directives
|  |  └── _scalars
|  ├── repositories
|  |  └── repositories.d.ts
|  ├── services
|  |  └── services.d.ts
|  └── utils
|     └── utils.d.ts
├── tests
|  ├── calculator.test.ts
|  └── config
|     ├── global.d.ts
|     ├── jest.env.ts
|     ├── jest.global.ts
|     └── jest.setup.ts
└── tsconfig.json

No configuration or complicated folder structures, only the files you need to build your app. Once the installation is done, you can open your project folder:

cd my-api

Inside the newly created project, you can run some built-in commands:

npm run dev or yarn dev

Runs the app in development mode. Open http://localhost:3000/graphql to view it in the browser.

The API will automatically generate types from the graphql schema and reload if you make changes to the code. You will see the build errors and lint warnings in the console.

npm test or yarn test

Runs the functional tests.

Read more about testing.

npm run build or yarn build

Builds the app for production to the build folder.

Your app is ready to be deployed.

User Guide

You can find detailed instructions on using Create GraphQL API and many tips in its documentation.

How to Update to New Versions?

Please refer to the User Guide for this and other information.

Philosophy

  • One Dependency: There is only one build dependency. It uses schemaglue, schema-s2s, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration Required: You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

  • TODO: No Lock-In: You can “eject” to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.

What’s Included?

Your environment will have everything you need to build a GraphQL API:

  • ES6, TypeScript and syntax support.
  • Auto generated types from GraphQL schema.
  • Language extras beyond ES6 like the object spread operator.
  • ESLint with Standard Style Guide and auto formatter.
  • Functional test runner with built-in support for coverage reporting.
  • A live development server that warns about common mistakes.
  • An architecture that permits plugins.
  • Hassle-free updates for the above tools with two dependencies(graphql-api-scripts and graphql-api-scripts-dev).

The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can(cannot yet) "eject" and customize it, but then you will need to maintain this configuration.

Contributing

We'd love to have your helping hand on create-graphql-api! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

Acknowledgements

We are grateful to the authors of existing related projects for their ideas and collaboration:

License

Create GraphQL Express is open source software licensed as MIT.