Skip to content

Commit fc5815a

Browse files
Merge remote-tracking branch 'upstream/master'
# Conflicts: # juniper_codegen/src/lib.rs
2 parents 891c881 + 036152e commit fc5815a

File tree

157 files changed

+13873
-7447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+13873
-7447
lines changed

.travis.yml

+23-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
language: rust
2-
cache: cargo
3-
sudo: true
42

53
rust:
64
- stable
75
- beta
86
- nightly
97

108
# Prevent accidentally breaking older Rust versions
11-
- 1.22.0
12-
- 1.21.0
9+
- 1.31.0
10+
- 1.30.0
11+
12+
matrix:
13+
include:
14+
- language: rust
15+
rust: stable
16+
name: "check wasm32 support"
17+
install: rustup target add wasm32-unknown-unknown
18+
script: cargo check --target wasm32-unknown-unknown --package juniper --package juniper_codegen
1319

1420
env:
1521
global:
1622
- secure: "SsepHEYRmW9ee3RhxPpqGuPigZINFfA/yOwUJFseQt4t+Zs90r1xdl3Q8eDfPlnvBsL7Rd0QQrFDO7JUaimVLlgQkUnrl62o0CYzkodp+qtocyAHS00W6WTqi8Y6E6KBxPshCl03dRLaySUfx5TqTLTIHkJ0G6vDW35k7hRrA3221lRphs5rrpvAZ21pqsDsNLH3HVo792L6A0kOtBa3ocw1pgHLxnBbArIViu2htUuFvY/TgsmVbAdlow0efw/xkcJ/p0/r5q7igLek6Iqk8udfRc7CktvoiFQ2vUnhtNtQu/zYll3Q7OUx5d+w5lhbzz2QINmsezBEisH9k1haL7dMviLPp0pn4WZed60KovO0Iqfgjy1utTaKvJVfNWYsgkfU8c9a/z2rcZOKwXNKQW2ptBrtVjaB9dk7eMoyuFCDZwNtKqvG+ZKmvMpun+R8mmx+buOmN8Vlf5ygIoGxz3nbEtlLYGVTXHfdXXqRkFIwtiYVJEO7SLRKT9pbx1E++ARsi2+y8bXJT4e4z0osYMq9EsiFUpw3J2gcshrgseqkB7UgCZ3SXuitJnJNfDAU3a3nwwS/JiAunZMNnC4rKUBbl7WbTB4Cpw7EgVOlCqcyyzlkNl3xabLzTFzLOfSHLTVX5FmGNsD21vBoS5/8ejftx9wuV3rGHxuO3i3+A3k="
1723
- RUSTFLAGS="-C link-dead-code"
1824
- CARGO_MAKE_RUN_CODECOV=true
1925

26+
before_script:
27+
- |
28+
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
29+
powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
30+
fi
31+
- |
32+
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
33+
_build/cargo-make.sh "0.15.3" "x86_64-unknown-linux-musl"
34+
fi
35+
- |
36+
if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
37+
_build/cargo-make.sh "0.15.3" "x86_64-apple-darwin"
38+
fi
2039
script:
21-
- wget -O ~/.cargo/bin/cargo-make https://bintray.com/sagiegurari/cargo-make/download_file?file_path=cargo-make_v0.11.0u
22-
- chmod 777 ~/.cargo/bin/cargo-make
2340
- cargo make workspace-ci-flow --no-workspace
2441

2542
before_deploy:
@@ -40,14 +57,3 @@ deploy:
4057
after_deploy:
4158
- cd juniper_codegen && cargo publish --token "$CRATES_IO_TOKEN" && cd ..
4259
- cd juniper && cargo publish --token "$CRATES_IO_TOKEN" && cd ..
43-
44-
before_cache:
45-
rm -rf target/debug/juniper*
46-
rm -rf target/debug/libjuniper*
47-
rm -rf target/debug/.fingerprint/juniper*
48-
49-
rm -rf target/release/juniper*
50-
rm -rf target/release/libjuniper*
51-
rm -rf target/release/.fingerprint/juniper*
52-
53-
rm -rf target/package/

Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[workspace]
2+
# Order is important as this is the order the crates will be released.
23
members = [
3-
"juniper",
44
"juniper_codegen",
5-
"juniper_tests",
5+
"juniper",
6+
"integration_tests/juniper_tests",
7+
"integration_tests/juniper_2018_edition_tests",
8+
"juniper_hyper",
69
"juniper_iron",
710
"juniper_rocket",
11+
"juniper_warp",
812
]

Makefile.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://github.com/sagiegurari/cargo-make#automatically-extend-workspace-makefile
2+
[env]
3+
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
4+
5+
# Run `cargo make release` to push a new minor release of every crate.
6+
[tasks.release]
7+
args = ["release", "--config", "../_build/release.toml"]
8+
9+
# Run `cargo make release-patch` to push a new patch release of every crate.
10+
[tasks.release-patch]
11+
args = ["release", "--config", "../_build/release.toml", "patch"]
12+
13+
# Run `cargo make release-dry-run` to do a dry run.
14+
[tasks.release-dry-run]
15+
description = "Run `cargo-release --dry-run` for every crate"
16+
command = "${HOME}/src/cargo-release/target/debug/cargo-release"
17+
args = ["release", "--config", "../_build/release.toml", "--dry-run"]

README.md

+30-31
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,52 @@
1-
<img src="https://github.com/graphql-rust/juniper/blob/master/assets/logo/juniper-dark-word.png" alt="Juniper" width="500" />
2-
1+
<img src="https://github.com/graphql-rust/juniper/raw/master/assets/logo/juniper-dark-word.png" alt="Juniper" width="500" />
32

43
> GraphQL server library for Rust
54
65
[![Build Status](https://travis-ci.org/graphql-rust/juniper.svg?branch=master)](https://travis-ci.org/graphql-rust/juniper)
7-
[![Build status](https://ci.appveyor.com/api/projects/status/xav6tor6biu617uu?svg=true)](https://ci.appveyor.com/project/theduke/juniper)
6+
[![Build Status](https://dev.azure.com/graphql-rust/GraphQL%20Rust/_apis/build/status/graphql-rust.juniper)](https://dev.azure.com/graphql-rust/GraphQL%20Rust/_build/latest?definitionId=1)
87
[![codecov](https://codecov.io/gh/graphql-rust/juniper/branch/master/graph/badge.svg)](https://codecov.io/gh/graphql-rust/juniper)
98
[![Crates.io](https://img.shields.io/crates/v/juniper.svg?maxAge=2592000)](https://crates.io/crates/juniper)
109
[![Gitter chat](https://badges.gitter.im/juniper-graphql/gitter.png)](https://gitter.im/juniper-graphql)
1110

12-
1311
---
1412

1513
[GraphQL][graphql] is a data query language developed by Facebook intended to
16-
serve mobile and web application frontends.
14+
serve mobile and web application frontends.
1715

18-
*Juniper* makes it possible to write GraphQL servers in Rust that are
19-
type-safe and blazingly fast. We also try to make declaring and resolving
16+
_Juniper_ makes it possible to write GraphQL servers in Rust that are
17+
type-safe and blazingly fast. We also try to make declaring and resolving
2018
GraphQL schemas as convenient as possible as Rust will allow.
2119

2220
Juniper does not include a web server - instead it provides building blocks to
2321
make integration with existing servers straightforward. It optionally provides a
24-
pre-built integration for the [Iron][iron] and [Rocket] frameworks, including
22+
pre-built integration for the [Hyper][hyper], [Iron][iron], [Rocket], and [Warp][warp] frameworks, including
2523
embedded [Graphiql][graphiql] for easy debugging.
2624

27-
* [Cargo crate](https://crates.io/crates/juniper)
28-
* [API Reference][docsrs]
29-
* [Book][book]: Guides and Examples
30-
25+
- [Cargo crate](https://crates.io/crates/juniper)
26+
- [API Reference][docsrs]
27+
- [Book][book]: Guides and Examples
3128

3229
## Getting Started
3330

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

37-
To get started quickly and get a feel for Juniper, check out the
34+
To get started quickly and get a feel for Juniper, check out the
3835
[Quickstart][book_quickstart] section.
3936

40-
For specific information about macros, types and the Juniper api, the
37+
For specific information about macros, types and the Juniper api, the
4138
[API Reference][docsrs] is the best place to look.
4239

4340
You can also check out [src/tests/schema.rs][test_schema_rs] to see a complex
44-
schema including polymorphism with traits and interfaces.
45-
For an example of web framework integration,
46-
see the [rocket][rocket_examples] and [iron][iron_examples] examples folders.
47-
41+
schema including polymorphism with traits and interfaces.
42+
For an example of web framework integration,
43+
see the [hyper][hyper_examples], [rocket][rocket_examples], [iron][iron_examples], and [warp][warp_examples] examples folders.
4844

4945
## Features
5046

5147
Juniper supports the full GraphQL query language according to the
52-
[specification][graphql_spec], including interfaces, unions, schema
53-
introspection, and validations.
48+
[specification][graphql_spec], including interfaces, unions, schema
49+
introspection, and validations.
5450
It does not, however, support the schema language.
5551

5652
As an exception to other GraphQL libraries for other languages, Juniper builds
@@ -66,19 +62,20 @@ Juniper has automatic integration with some very common Rust crates to make
6662
building schemas a breeze. The types from these crates will be usable in
6763
your Schemas automatically.
6864

69-
* [uuid][uuid]
70-
* [url][url]
71-
* [chrono][chrono]
65+
- [uuid][uuid]
66+
- [url][url]
67+
- [chrono][chrono]
7268

7369
### Web Frameworks
7470

75-
* [rocket][rocket]
76-
* [iron][iron]
71+
- [hyper][hyper]
72+
- [rocket][rocket]
73+
- [iron][iron]
74+
- [warp][warp]
7775

7876
## Guides & Examples
7977

80-
* [Juniper + actix-web example](https://github.com/actix/examples/tree/master/juniper)
81-
78+
- [Juniper + actix-web example](https://github.com/actix/examples/tree/master/juniper)
8279

8380
## API Stability
8481

@@ -90,14 +87,16 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
9087
[graphql_spec]: http://facebook.github.io/graphql
9188
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/schema.rs
9289
[tokio]: https://github.com/tokio-rs/tokio
90+
[hyper_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_hyper/examples
9391
[rocket_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_rocket/examples
9492
[iron_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_iron/examples
95-
[Rocket]: https://rocket.rs
93+
[hyper]: https://hyper.rs
94+
[rocket]: https://rocket.rs
9695
[book]: https://graphql-rust.github.io
9796
[book_quickstart]: https://graphql-rust.github.io/quickstart.html
9897
[docsrs]: https://docs.rs/juniper
99-
98+
[warp]: https://github.com/seanmonstar/warp
99+
[warp_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_warp/examples
100100
[uuid]: https://crates.io/crates/uuid
101101
[url]: https://crates.io/crates/url
102102
[chrono]: https://crates.io/crates/chrono
103-

_build/azure-pipelines-template.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
jobs:
2+
- job: ${{ parameters.name }}
3+
pool:
4+
vmImage: ${{ parameters.vmImage }}
5+
strategy:
6+
matrix:
7+
stable:
8+
rustup_toolchain: stable
9+
beta:
10+
rustup_toolchain: beta
11+
nightly:
12+
rustup_toolchain: nightly
13+
minimum_supported_version_plus_one:
14+
rustup_toolchain: 1.31.0
15+
minimum_supported_version:
16+
rustup_toolchain: 1.30.0
17+
steps:
18+
- ${{ if ne(parameters.name, 'Windows') }}:
19+
# Linux and macOS.
20+
- script: |
21+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
22+
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
23+
displayName: Install rust
24+
- ${{ if eq(parameters.name, 'Windows') }}:
25+
# Windows.
26+
- script: |
27+
curl -sSf -o rustup-init.exe https://win.rustup.rs
28+
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
29+
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
30+
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
31+
displayName: Install rust (windows)
32+
# All platforms.
33+
- script: |
34+
rustc -Vv
35+
cargo -V
36+
displayName: Query rust and cargo versions
37+
- ${{ if eq(parameters.name, 'Linux') }}:
38+
# Linux.
39+
- script: _build/cargo-make.sh "0.15.3" "x86_64-unknown-linux-musl"
40+
displayName: Install cargo-make binary
41+
- ${{ if eq(parameters.name, 'macOS') }}:
42+
# Mac.
43+
- script: _build/cargo-make.sh "0.15.3" "x86_64-apple-darwin"
44+
displayName: Install cargo-make binary
45+
- ${{ if eq(parameters.name, 'Windows') }}:
46+
# Windows.
47+
- script: powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
48+
displayName: Install cargo-make binary
49+
- script: cargo make workspace-ci-flow --no-workspace
50+
env: { CARGO_MAKE_RUN_CODECOV: true }
51+
displayName: Build and run tests
52+
- script: |
53+
rustup target add wasm32-unknown-unknown
54+
cargo check --target wasm32-unknown-unknown --package juniper --package juniper_codegen
55+
displayName: Check WebAssembly target
56+
condition: eq(variables['rustup_toolchain'], 'stable')

_build/cargo-make.ps1

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
param (
2+
[Parameter(Mandatory=$true)][string]$version,
3+
[Parameter(Mandatory=$true)][string]$target
4+
)
5+
6+
# Location to put cargo-make binary.
7+
$cargobindir = "$env:userprofile\.cargo\bin"
8+
9+
# Location to stage downloaded zip file.
10+
$zipfile = "$env:temp\cargo-make.zip"
11+
12+
$url = "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-${target}.zip"
13+
14+
# Download the zip file.
15+
Invoke-WebRequest -Uri $url -OutFile $zipfile
16+
17+
# Extract the binary to the correct location.
18+
Expand-Archive -Path $zipfile -DestinationPath $cargobindir
19+
20+
# Tell azure pipelines the PATH has changed for future steps.
21+
Write-Host "##vso[task.setvariable variable=PATH;]%PATH%;$cargobindir"

_build/cargo-make.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
if [ -z ${1+x} ];
4+
then
5+
echo "Missing version as first argument";
6+
exit 1
7+
fi
8+
9+
if [ -z ${2+x} ];
10+
then
11+
echo "Missing target as second argument";
12+
exit 1
13+
fi
14+
15+
curl https://github.com/sagiegurari/cargo-make/releases/download/${1}/cargo-make-v${1}-${2}.zip -sSfL -o /tmp/cargo-make.zip;
16+
unzip /tmp/cargo-make.zip;
17+
mv cargo-make-*/* $HOME/.cargo/bin;
18+
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"

_build/release.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
no-dev-version = true
2+
pre-release-commit-message = "Release {{crate_name}} {{version}}"
3+
pro-release-commit-message = "Bump {{crate_name}} version to {{next_version}}"
4+
tag-message = "Release {{crate_name}} {{version}}"
5+
upload-doc = false
6+
pre-release-replacements = [
7+
{file="CHANGELOG.md", search="# master", replace="# master\n\n- No changes yet\n\n# [[{{version}}] {{date}}](https://github.com/graphql-rust/juniper/releases/tag/{{crate_name}}-{{version}})"},
8+
]

appveyor.yml

-41
This file was deleted.

azure-pipelines.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
jobs:
2+
3+
- job: check_formatting
4+
pool:
5+
vmImage: ubuntu-16.04
6+
steps:
7+
- script: |
8+
curl https://sh.rustup.rs -sSf | sh -s -- -y
9+
$HOME/.cargo/bin/rustup component add rustfmt
10+
displayName: Install rust
11+
- script: |
12+
$HOME/.cargo/bin/cargo fmt -- --check
13+
displayName: Check formatting
14+
15+
- template: _build/azure-pipelines-template.yml
16+
parameters:
17+
name: Linux
18+
vmImage: ubuntu-16.04
19+
20+
- template: _build/azure-pipelines-template.yml
21+
parameters:
22+
name: macOS
23+
vmImage: macOS-10.13
24+
25+
- template: _build/azure-pipelines-template.yml
26+
parameters:
27+
name: Windows
28+
vmImage: vs2017-win2016

0 commit comments

Comments
 (0)