Commit graph

55 commits

Author SHA1 Message Date
Christian Legnitto
c4319b6449
Update quickstart.md 2020-07-15 21:24:57 -10:00
Christian Legnitto
5ddd2d499f
Add heading for error handling and point to spec
Fixes https://github.com/graphql-rust/juniper/issues/695.
2020-07-15 21:09:19 -10:00
Christian Legnitto
61a5a747f1
Update subscriptions.md 2020-07-14 21:02:30 -10:00
Christian Legnitto
8c3857d772
Update schemas_and_mutations.md 2020-07-14 20:45:42 -10:00
Christian Legnitto
480eda9846
Update schemas_and_mutations.md 2020-07-14 20:41:08 -10:00
Andres Rodriguez
f0ee2094d3
chore(docs): fix typo in complex fields section (#698) 2020-07-14 23:03:39 +03:00
Christian Legnitto
a08ce0760d
Add note about i64/u64 to the book
Fixes https://github.com/graphql-rust/juniper/issues/671
2020-06-23 22:41:09 -10:00
Christian Legnitto
9167654a73
Add support for GraphQL Schema Language (#676)
Co-authored-by: Alexander Lyon <arlyon@me.com>
2020-06-05 17:43:11 -10:00
Kai Ren
ddc1488195
Codegen reimplementation for GraphQL unions (#666)
- reimplement #[derive(GraphQLUnion)] macro to support:
    - both structs and enums
    - generics in type definition
    - multiple #[graphql] attributes
    - external resolver functions
- remove From trait impls generation for enum variants

- reimplement #[graphql_union] macro to support:
    - traits
    - generics in trait definition
    - multiple attributes
    - external resolver functions
    - GraphQLType implemetation for a raw trait object
    - GraphQLTypeAsync implemetation (#549)

- add marker::GraphQLUnion trait

- rewrite "2.5 Unions" section in Book (Juniper user documentation)

- rewrite `codegen` and `codegen_fail` integration tests for GraphQL unions

Additionally:
- re-export `futures` crate in `juniper` for convenient reuse in the generated code without requiring library user to provide `futures` crate by himself (#663)
- use unit type () as default context for EmptyMutation and EmptySubscriptions
- relax Sized trait bound on some GraphQLType and GraphQLTypeAsync definitions, implementations and usages
2020-06-04 11:19:01 +03:00
Julio Daniel Reyes
91a3353983
Update dataloader explanation code (#661) 2020-05-13 16:37:14 -10:00
Jonas Meurer
845331033e
Documented Alternative Error Handling (#634)
* Added alternative error handling

* Fixed book tests and some sentences

* Apply suggestions from code review

Co-Authored-By: Christian Legnitto <LegNeato@users.noreply.github.com>

* Fixed book examples

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-28 06:41:19 -10:00
Christian Legnitto
892619a35b
Fix typos in dataloader docs 2020-04-25 20:26:16 -10:00
André Isaksson Kraft
2ba9f71b0c
Make graphql_scalar a proc macro (#610)
Fixes #571

Signed-off-by: andrisak <andrisak@gmail.com>

* Replaced the old macro with the new proc macro.
Updated documentation.

Signed-off-by: andrisak <andrisak@gmail.com>

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-20 10:15:09 -10:00
Jonas Meurer
fe99e1cc70
Allow specifying scalar and context for GraphQLEnum (#621)
* Updated implementation of derive enum

- allows context specification
- allows scalar specification
- shares code with derive object

* Added this feature to CHANGELOG

* Added matrix with supported macro attributes for enums

* Added case which checks for custom context

* GraphQLUnion now can use a different context per variant

* Moved context switch test for union into right folder

* Sync resolve expression has the same form as the other impls

* Disabled custom scalar on GraphQLEnum

* Fixed CHANGELOG

* Fixed support matrix of GraphQLEnum in the book

- scalar not supported!
- skip not supported!

* Added test case for "noasync" derive attribute

* Disallowed generics and lifetimes on GraphQLEnum

* Added error message for duplicate naming

* Added error message for empty variant
2020-04-17 19:09:04 -10:00
Jordão Rodrigues Oliveira Rosario
7e8724751f
Initial implementation of Subscription Docs (#609)
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-16 20:16:00 -10:00
Jonas Meurer
a05f4e55c4
Derive macro for tagged enums (GraphQLUnion) (#618)
* Implemented device macro for GraphQLUnion's

* Updated PR link in CHNAGELOG

* Disabled documentation on enumeration fields

* Disabled skip on fields

* Changed implementation for std::convert::Into since skip is not possible

* Added documentation for GraphQLUnion

* Added tests for GraphQLUnion

* Fixed typos in error messages (as suggested by review)

* Fixed failing documentation example

* Utilized `resolver_code` in `util::GraphQLTypeDefinitionField`.

Simplifies code and provides the idea of using
`util::GraphQLTypeDefinitionField` for different types than objects.

* Removed wrong statement about skip annotation in docs.

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-14 21:58:45 -10:00
Yusuke Sasaki
a275c8dcc2
doc: remove outdated examples from third-party integrations list (#572) 2020-03-18 20:46:32 -07:00
nWacky
eb941e509a
Add subscription support (#433)
Co-authored-by: tyranron <tyranron@gmail.com>
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-18 20:31:36 -07:00
Christian Legnitto
e9b8aa2c38
Rename execute -> execute_sync, execute_async -> execute (#556) 2020-03-09 22:40:26 -07:00
Christian Legnitto
00b111a1ff
Remove async feature gate (#554)
This still has the async / non-async split. Future diffs will get
rid of `GraphQLTypeAsync` and move everything into `GraphQLType`.
2020-03-08 23:20:11 -07:00
Félix Gagnon-Grenier
15e9bffa84
Warning about normal methods (#545)
There's a comment [here](https://docs.rs/juniper/0.14.2/juniper/attr.object.html) that only GraphQL fields can be specified in `#[juniper::object]` impl block, yet in the book it was not specified, I needed help to get the idea to try it.

I simply copied that information because it feels important.

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-04 08:58:52 -08:00
Victor-Nicolae Savu
f5e4b6b9b6
Match the list of integrations to the page order (#548)
* Remove duplicate link to Hyper integration

The `Adding a Server` page contains a duplicate link to `Hyper`. The first of them can cause the reader to accidentally skip the `Rocket` and `Iron` integration pages because their pages are before the one for `Hyper` in the reading order. 

Remove the first link so that the list of official server integrations matches the page order.

* Match the list of integrations to the page order

In the book, the pages for the official integrations appear in the order: `Warp`, `Rocket`, `Iron`, `Hyper`, but on the `Official Server Integrations` page they are listed with `Hyper` first. This can cause readers to accidentally skip the other three integrations if they click on the link for `Hyper` first. 

Move `Hyper` to the bottom of the list to match the reading order of the book.

* Remove unnecessary blank line
2020-03-02 09:57:17 +01:00
Christian Legnitto
8925f64983
Temporarily disable interface tests (#543)
These aren't reimplemented yet as proc macros. Disabling them
so book tests on PRs pass and the website is updated.
2020-02-20 23:21:41 -07:00
Nathan Wilson
389fd5ca19
Add bson crate's ObjectId to juniper foreign scalar type integrations (#517) 2020-02-12 23:49:50 -07:00
James H
df2740393a
Add dataloader explaination to book (#518) 2020-02-12 23:45:15 -07:00
tyranron
c51c675306
Use caret requirement for specifying 'futures' crate version 2020-02-04 09:57:47 +01:00
tyranron
dd9c201352 Upgrade uuid to 0.8 version 2020-01-29 01:59:42 -05:00
Andy Swan
ab498f2f24
fixing a double spell 2020-01-28 11:07:25 +00:00
Christian Legnitto
31ca3e6156 Add async to doc tests 2020-01-21 08:38:13 -08:00
Christian Legnitto
73dc5cd5b8 Release juniper 0.14.2 2020-01-18 17:14:35 -08:00
Samuel Hurel
5b1c5c697a Add note on complex fields impl block in doc (#483) 2020-01-18 17:14:35 -08:00
Klaus Purer
4a91d9d205 docs(quickstart): Fix juniper version so the examples work 2020-01-18 17:14:35 -08:00
Christoph Herzog
ce3cf45ca9 Rename object proc macro to graphql_object 2019-11-16 02:57:48 +01:00
Christoph Herzog
46590ae884 book: Fix union and scalar code examples 2019-11-16 02:33:20 +01:00
Christoph Herzog
97e1005178 Clean up ScalarValue transparent derive argument handling and documentation. 2019-06-25 18:55:45 +02:00
Christoph Herzog
3396074274 (codegen) Implement newtype derive for scalars.
This commit implements a newtype style custom derive
for scalars via `#[derive(GraphQLScalarValue)]`, which now
supports both deriving a base enum scalar type and newtypes.

For newtypes, the `#[graphql(transparent)]` attribute is
required.

This commit:
* implements the derive
* adds integration tests
* updates the book
2019-06-25 18:55:45 +02:00
Clayton Ray
c2f119690b fix(docs): correct warp example link in book (#367)
This fix adds the correct link for the Warp Server example.
2019-05-25 18:56:35 -07:00
Christoph Herzog
74522b015e (book) Update the graphql_scalar! example to be generic
This is now basically a requirement due to GraphQLObject derive
being generic.
2019-05-17 19:26:01 +02:00
Christoph Herzog
cff6036206 (book) Add ::object macro field and argument customization info 2019-05-16 14:08:19 +02:00
Christoph Herzog
29025e6cae
Rename impl_object to object. 2019-05-13 21:15:14 +02:00
Christoph Herzog
693405afa5
(book) impl_object refactor 2019-05-12 10:36:30 +02:00
Rogerio Moura
dbfcc762da Specify path to graphql_object module (#352) 2019-05-05 20:20:21 -07:00
Christian Legnitto
0f78417f44
Delete yarn.lock (#351)
Not needed now that we have switched to mdbook
2019-05-03 00:39:58 -07:00
Christian Legnitto
37a9d02850
Fix failure when no book content has changed
If there is no new book content, `git commit` will return `1` and the entire job will error. Took answer from https://stackoverflow.com/questions/8123674/how-to-git-commit-nothing-without-an-error
2019-05-03 00:39:33 -07:00
Christoph Herzog
5a4230e0d0
Remove macro_use + extern crate statements (2018 edition) 2019-05-02 18:44:56 +02:00
Christian Legnitto
b96879e2db Add a git ssh origin when pushing docs
Azure apparently downloads the source via http,
so when we go to push the ssh keychain is not used.
adding origin shoudl fix it, as was done in
https://cloudblogs.microsoft.com/opensource/2019/04/05/publishing-github-pages-from-azure-pipelines/
2019-04-16 21:52:58 -07:00
Christian Legnitto
94cc621598 Attempt to fix docs
Cribbed from https://cloudblogs.microsoft.com/opensource/2019/04/05/publishing-github-pages-from-azure-pipelines/
and https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/install-ssh-key?view=azure-devops
2019-04-16 21:27:24 -07:00
Christian Legnitto
17e564c6f0
Use bash for docs scripts
This is erroring out on CI as `pipefail` is a bash-ism AFAICT.
2019-04-15 21:41:00 -07:00
Christoph Herzog
3165467665 (book) Remove inexistant tutorial link 2019-04-10 03:00:35 +02:00
Christoph Herzog
ff66b89baa tmp 2019-04-10 02:30:38 +02:00