## File: README.md

> GraphQL server library for Rust

[](https://dev.azure.com/graphql-rust/GraphQL%20Rust/_build/latest?definitionId=1)
[](https://codecov.io/gh/graphql-rust/juniper)
[](https://crates.io/crates/juniper)
[](https://gitter.im/juniper-graphql/Lobby)

---

[GraphQL][graphql] is a data query language developed by Facebook intended to
serve mobile and web application frontends.

_Juniper_ makes it possible to write GraphQL servers in Rust that are
type-safe and blazingly fast. We also try to make declaring and resolving
GraphQL schemas as convenient as Rust will allow.

Juniper does not include a web server - instead it provides building blocks to
make integration with existing servers straightforward. It optionally provides a
pre-built integration for the [Actix][actix], [Hyper][hyper], [Rocket], and [Warp][warp] frameworks, including
embedded [Graphiql][graphiql] and [GraphQL Playground][playground] for easy debugging.

- [Cargo crate](https://crates.io/crates/juniper)
- [API Reference][docsrs]
- [Book][book]: Guides and Examples ([current][book] | [master][book_master])

The book is also available for the master branch and older versions published after 0.11.1. See the [book index][book_index].


## Getting Started

The best place to get started is the [Juniper Book][book], which contains
guides with plenty of examples, covering all features of Juniper. (very much WIP)

To get started quickly and get a feel for Juniper, check out the
[Quickstart][book_quickstart] section.

For specific information about macros, types and the Juniper api, the
[API Reference][docsrs] is the best place to look.

You can also check out the [Star Wars schema][test_schema_rs] to see a complex
example including polymorphism with traits and interfaces.
For an example of web framework integration,
see the [actix][actix_examples], [axum][axum_examples], [hyper][hyper_examples], [rocket][rocket_examples], and [warp][warp_examples] examples folders.

## Features

Juniper supports the full GraphQL query language according to the
[specification (October 2021)][graphql_spec], including interfaces, unions, schema
introspection, and validations. It can also output the schema in the [GraphQL Schema Language][schema_language].

As an exception to other GraphQL libraries for other languages, Juniper builds
non-null types by default. A field of type `Vec<Episode>` will be converted into
`[Episode!]!`. The corresponding Rust type for e.g. `[Episode]` would be
`Option<Vec<Option<Episode>>>`.

Juniper is agnostic to serialization format and network transport.

Juniper supports both asynchronous and synchronous execution using `execute()` and `execute_sync()` respectively. Asynchronous execution is runtime agnostic.

Juniper follows a [code-first approach][schema_approach] to defining GraphQL schemas. If you would like to use a [schema-first approach][schema_approach] instead, consider [juniper-from-schema][] for generating code from a schema file.

## Integrations

### Data types

Juniper has automatic integration with some very common Rust crates to make
building schemas a breeze. The types from these crates will be usable in
your Schemas automatically.

- [uuid][uuid]
- [url][url]
- [chrono][chrono]
- [chrono-tz][chrono-tz]
- [jiff][jiff]
- [time][time]
- [bson][bson]

### Web Frameworks

- [actix][actix]
- [axum][axum]
- [hyper][hyper]
- [rocket][rocket]
- [warp][warp]

## Guides & Examples

- [Juniper + actix-web example](https://github.com/actix/examples/tree/master/graphql/juniper)

## API Stability

Juniper has not reached 1.0 yet, thus some API instability should be expected.

[actix]: https://actix.rs/
[axum]: https://docs.rs/axum
[graphql]: http://graphql.org
[graphiql]: https://github.com/graphql/graphiql
[playground]: https://github.com/prisma/graphql-playground
[graphql_spec]: https://spec.graphql.org/October2021
[schema_language]: https://graphql.org/learn/schema/#type-language
[schema_approach]: https://blog.logrocket.com/code-first-vs-schema-first-development-graphql/
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/fixtures/starwars/schema.rs
[tokio]: https://github.com/tokio-rs/tokio
[actix_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_actix/examples
[axum_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_axum/examples
[hyper_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_hyper/examples
[rocket_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_rocket/examples
[hyper]: https://hyper.rs
[rocket]: https://rocket.rs
[book]: https://graphql-rust.github.io/juniper
[book_master]: https://graphql-rust.github.io/juniper/master
[book_index]: https://graphql-rust.github.io/juniper
[book_quickstart]: https://graphql-rust.github.io/juniper/quickstart.html
[docsrs]: https://docs.rs/juniper
[warp]: https://github.com/seanmonstar/warp
[warp_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_warp/examples
[uuid]: https://crates.io/crates/uuid
[url]: https://crates.io/crates/url
[chrono]: https://crates.io/crates/chrono
[chrono-tz]: https://crates.io/crates/chrono-tz
[jiff]: https://crates.io/crates/jiff
[time]: https://crates.io/crates/time
[bson]: https://crates.io/crates/bson
[juniper-from-schema]: https://github.com/davidpdrsn/juniper-from-schema

---

## File: assets/logo/README.md

The rust-graphql logo is a derivative work based on

* The GraphQL Logo licensed under the terms of the BSD license
* The Rust Logo licensed under the terms of the CC-BY license

---

## File: book/README.md

Juniper Book
============

Book containing the [`juniper`](https://docs.rs/juniper) user guide.




## Contributing


### Requirements

The Book is built with [mdBook](https://github.com/rust-lang/mdBook).

You may install it with:
```bash
cargo install mdbook
```


### Local test server

To launch a local test server that continually re-builds the Book and auto-reloads the page, run:
```bash
mdbook serve

# or from project root dir:
make book.serve
```


### Building

You may build the Book to rendered HTML with this command:
```bash
mdbook build

# or from project root dir:
make book
```

The output will be in the `_rendered/` directory.


### Testing

To run the tests validating all code examples in the book, run (from project root dir):
```bash
cargo build
mdbook test -L target/debug/deps

# or via shortcut:
make test.book
```

---

## File: juniper/README.md

Juniper (GraphQL server library for Rust)
=========================================

[](https://crates.io/crates/juniper)
[](https://docs.rs/juniper)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html)

- [Juniper Book] ([current][Juniper Book] | [edge][Juniper Book edge])
- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper-v0.17.1/juniper/CHANGELOG.md)


[GraphQL] is a data query language developed by [Facebook] and intended to serve mobile and web application frontends.

*[Juniper]* makes it possible to write [GraphQL] servers in [Rust] that are type-safe and blazingly fast. We also try to make declaring and resolving [GraphQL] schemas as convenient as [Rust] will allow.

[Juniper] doesn't include a web server - instead it provides building blocks to make integration with existing servers straightforward, including embedded [GraphiQL] and/or [GraphQL Playground] for easy debugging.




## Getting Started

The best place to get started is [Juniper Book], which contains guides with plenty of examples, covering all features of [Juniper].

To get started quickly and get a feel for Juniper, check out the ["Quickstart" section][1].

For specific information about macros, types and the [Juniper] API, the [API docs][Juniper] is the best place to look.




## Features

[Juniper] supports the full [GraphQL] query language according to [October 2021 GraphQL specification](https://spec.graphql.org/October2021), including interfaces, unions, schema introspection, and validations. It does not, however, support the schema language.

As an exception to other [GraphQL] libraries for other languages, [Juniper] builds non-`null` types by default. A field of type `Vec<Episode>` will be converted into `[Episode!]!`. The corresponding Rust type for e.g. `[Episode]` would be `Option<Vec<Option<Episode>>>`.




## Integrations


### Types

[Juniper] provides out-of-the-box integration for some very common [Rust] crates to make building schemas a breeze. The types from these crates will be usable in your schemas automatically after enabling the correspondent self-titled [Cargo feature]:
- [`bigdecimal`]
- [`bson`]
- [`chrono`], [`chrono-tz`]
- [`jiff`]
- [`ruint`]
- [`rust_decimal`]
- [`time`]
- [`url`]
- [`uuid`]


### Web server frameworks

- [`actix-web`] ([`juniper_actix`] crate)
- [`axum`] ([`juniper_axum`] crate)
- [`hyper`] ([`juniper_hyper`] crate)
- [`rocket`] ([`juniper_rocket`] crate)
- [`warp`] ([`juniper_warp`] crate)




## API stability

[Juniper] has not reached 1.0 yet, thus some API instability should be expected.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper-v0.17.1/juniper/LICENSE).




[`actix-web`]: https://docs.rs/actix-web
[`axum`]: https://docs.rs/axum
[`bigdecimal`]: https://docs.rs/bigdecimal
[`bson`]: https://docs.rs/bson
[`chrono`]: https://docs.rs/chrono
[`chrono-tz`]: https://docs.rs/chrono-tz
[`jiff`]: https://docs.rs/jiff
[`juniper_actix`]: https://docs.rs/juniper_actix
[`juniper_axum`]: https://docs.rs/juniper_axum
[`juniper_hyper`]: https://docs.rs/juniper_hyper
[`juniper_rocket`]: https://docs.rs/juniper_rocket
[`juniper_warp`]: https://docs.rs/juniper_warp
[`hyper`]: https://docs.rs/hyper
[`rocket`]: https://docs.rs/rocket
[`ruint`]: https://docs.rs/ruint
[`rust_decimal`]: https://docs.rs/rust_decimal
[`time`]: https://docs.rs/time
[`url`]: https://docs.rs/url
[`uuid`]: https://docs.rs/uuid
[`warp`]: https://docs.rs/warp
[Cargo feature]: https://doc.rust-lang.org/cargo/reference/features.html
[Facebook]: https://facebook.com
[GraphiQL]: https://github.com/graphql/graphiql
[GraphQL]: http://graphql.org
[GraphQL Playground]: https://github.com/graphql/graphql-playground
[Juniper]: https://docs.rs/juniper
[Juniper Book]: https://graphql-rust.github.io/juniper
[Juniper Book edge]: https://graphql-rust.github.io/juniper/master
[Rust]: https://www.rust-lang.org

[1]: https://graphql-rust.github.io/juniper/quickstart.html

---

## File: juniper_actix/README.md

`juniper_actix` crate
=====================

[](https://crates.io/crates/juniper_actix)
[](https://docs.rs/juniper_actix)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/06/26/Rust-1.88.0)

- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper_actix-v0.7.0/juniper_actix/CHANGELOG.md)

[`actix-web`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]).

It's inspired and some parts are copied from [`juniper_warp`] crate.




## Documentation

For documentation, including guides and examples, check out [Juniper Book].

A basic usage example can also be found in the [API docs][`juniper_actix`].




## Examples

Check [`examples/subscription.rs`][1] for example code of a working [`actix-web`] server with [GraphQL] handlers.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper_actix-v0.7.0/juniper_actix/LICENSE).




[`actix-web`]: https://docs.rs/actix-web
[`juniper`]: https://docs.rs/juniper
[`juniper_actix`]: https://docs.rs/juniper_actix
[`juniper_warp`]: https://docs.rs/juniper_warp
[GraphQL]: http://graphql.org
[Juniper Book]: https://graphql-rust.github.io/juniper
[Rust]: https://www.rust-lang.org

[1]: https://github.com/graphql-rust/juniper/blob/juniper_actix-v0.7.0/juniper_actix/examples/subscription.rs

---

## File: juniper_axum/README.md

`juniper_axum` crate
====================

[](https://crates.io/crates/juniper_axum)
[](https://docs.rs/juniper_axum)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html)

- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper_axum-v0.3.0/juniper_axum/CHANGELOG.md)

[`axum`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]).




## Documentation

For documentation, including guides and examples, check out [Juniper Book].

A basic usage example can also be found in the [API docs][`juniper_axum`].




## Examples

Check [`examples/simple.rs`][1] and [`examples/custom.rs`][1] for example code of a working [`axum`] server with [GraphQL] handlers.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper_axum-v0.3.0/juniper_axum/LICENSE).




[`axum`]: https://docs.rs/axum
[`juniper`]: https://docs.rs/juniper
[`juniper_axum`]: https://docs.rs/juniper_axum
[GraphQL]: http://graphql.org
[Juniper Book]: https://graphql-rust.github.io/juniper
[Rust]: https://www.rust-lang.org

[1]: https://github.com/graphql-rust/juniper/blob/juniper_axum-v0.3.0/juniper_axum/examples/simple.rs
[2]: https://github.com/graphql-rust/juniper/blob/juniper_axum-v0.3.0/juniper_axum/examples/custom.rs

---

## File: juniper_codegen/README.md

`juniper_codegen` crate
=======================

[](https://crates.io/crates/juniper_codegen)
[](https://docs.rs/juniper_codegen)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html)

- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper_codegen-v0.17.0/juniper_codegen/CHANGELOG.md)

Code generation for [`juniper`] crate.

DO NOT use it directly, use [`juniper`] crate instead.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper_codegen-v0.17.0/juniper_codegen/LICENSE).




[`juniper`]: https://docs.rs/juniper

---

## File: juniper_hyper/README.md

`juniper_hyper` crate
=====================

[](https://crates.io/crates/juniper_hyper)
[](https://docs.rs/juniper_hyper)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html)

- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper_hyper-v0.10.0/juniper_hyper/CHANGELOG.md)

[`hyper`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]).




## Documentation

For documentation, including guides and examples, check out [Juniper Book].

A basic usage example can also be found in the [API docs][`juniper_hyper`].




## Examples

Check [`examples/hyper_server.rs`][1] for example code of a working [`hyper`] server with [GraphQL] handlers.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper_hyper-v0.10.0/juniper_hyper/LICENSE).




[`hyper`]: https://docs.rs/hyper
[`juniper`]: https://docs.rs/juniper
[`juniper_hyper`]: https://docs.rs/juniper_hyper
[GraphQL]: http://graphql.org
[Juniper Book]: https://graphql-rust.github.io/juniper
[Rust]: https://www.rust-lang.org

[1]: https://github.com/graphql-rust/juniper/blob/juniper_hyper-v0.10.0/juniper_hyper/examples/hyper_server.rs

---

## File: juniper_rocket/README.md

`juniper_rocket` crate
======================

[](https://crates.io/crates/juniper_rocket)
[](https://docs.rs/juniper_rocket)
[](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html)

- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper_rocket-v0.10.0/juniper_rocket/CHANGELOG.md)

[`rocket`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]).




## Documentation

For documentation, including guides and examples, check out [Juniper Book].

A basic usage example can also be found in the [API docs][`juniper_rocket`].




## Examples

Check [`examples/simple.rs`][1] for example code of a working [`rocket`] server with [GraphQL] handlers.




## License

This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/juniper_rocket-v0.10.0/juniper_rocket/LICENSE).




[`juniper`]: https://docs.rs/juniper
[`juniper_rocket`]: https://docs.rs/juniper_rocket
[`rocket`]: https://docs.rs/rocket
[GraphQL]: http://graphql.org
[Juniper Book]: https://graphql-rust.github.io/juniper
[Rust]: https://www.rust-lang.org

[1]: https://github.com/graphql-rust/juniper/blob/juniper_rocket-v0.10.0/juniper_rocket/examples/simple.rs