Skip to content

Commit

Permalink
Notes about browser use
Browse files Browse the repository at this point in the history
mention webpack and rollup support and dual-module support.

Closes #1272
  • Loading branch information
leebyron committed Apr 18, 2018
1 parent 60c03ab commit d708da2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ directly on this branch:
npm install graphql@git://github.com/graphql/graphql-js.git#npm
```

### Using in a Browser

GraphQL.js is a general purpose library and can be used both in a Node server
and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/)
tool is built with GraphQL.js!

Building a project using GraphQL.js with [webpack](https://webpack.js.org) or
[rollup](https://github.com/rollup/rollup) should just work and only include
the portions of the library you use. This works because GraphQL.js is distributed
with both CommonJS (`require()`) and ESModule (`import`) files. Ensure that any
custom build configurations look for `.mjs` files!

### Contributing

We actively welcome pull requests, learn how to
Expand Down

0 comments on commit d708da2

Please sign in to comment.