You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -48,14 +48,15 @@ see the [actix][actix_examples], [hyper][hyper_examples], [rocket][rocket_exampl
48
48
49
49
Juniper supports the full GraphQL query language according to the
50
50
[specification][graphql_spec], including interfaces, unions, schema
51
-
introspection, and validations.
52
-
It does not, however, support the schema language. Consider using [juniper-from-schema][] for generating code from a schema file.
51
+
introspection, and validations. It can also output the schema in the [GraphQL Schema Language][schema_language].
53
52
54
53
As an exception to other GraphQL libraries for other languages, Juniper builds
55
54
non-null types by default. A field of type `Vec<Episode>` will be converted into
56
55
`[Episode!]!`. The corresponding Rust type for e.g. `[Episode]` would be
57
56
`Option<Vec<Option<Episode>>>`.
58
57
58
+
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.
59
+
59
60
## Integrations
60
61
61
62
### Data types
@@ -91,6 +92,8 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
Copy file name to clipboardExpand all lines: docs/book/content/quickstart.md
+4
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
This page will give you a short introduction to the concepts in Juniper.
4
4
5
+
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.
Copy file name to clipboardExpand all lines: docs/book/content/schema/schemas_and_mutations.md
+51
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Schemas
2
2
3
+
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.
4
+
3
5
A schema consists of three types: a query object, a mutation object, and a subscription object.
4
6
These three define the root query fields, mutations and subscriptions of the schema, respectively.
5
7
@@ -60,6 +62,55 @@ impl Mutations {
60
62
# fnmain() { }
61
63
```
62
64
65
+
# Outputting schemas in the [GraphQL Schema Language][schema_language]
66
+
67
+
Many tools in the GraphQL ecosystem require the schema to be defined in the [GraphQL Schema Language][schema_language]. You can generate a [GraphQL Schema Language][schema_language] representation of your schema defined in Rust using the `schema-language` feature (on by default):
68
+
69
+
```rust
70
+
# // Only needed due to 2018 edition because the macro is not accessible.
Copy file name to clipboardExpand all lines: juniper/CHANGELOG.md
+3
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
3
3
## Features
4
4
5
+
- Added support for outputting the Rust schema in the [GraphQL Schema Language](https://graphql.org/learn/schema/#type-language). ([#676](https://github.com/graphql-rust/juniper/pull/676))
6
+
- This is controlled by the `schema-language` feature and is on by default. It may be turned off if you do not need this functionality to reduce dependencies and speed up compile times.
7
+
5
8
- Normalization for the subscriptions_endpoint_url in the `graphiql_source`.
6
9
(See [#628](https://github.com/graphql-rust/juniper/pull/628) for more details)
0 commit comments