From 15e9bffa8493df2e753f667114f073df0bbdaa5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Gagnon-Grenier?= Date: Wed, 4 Mar 2020 11:58:52 -0500 Subject: [PATCH] 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 --- docs/book/content/types/objects/complex_fields.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/book/content/types/objects/complex_fields.md b/docs/book/content/types/objects/complex_fields.md index e0832059..b0a90286 100644 --- a/docs/book/content/types/objects/complex_fields.md +++ b/docs/book/content/types/objects/complex_fields.md @@ -3,7 +3,9 @@ If you've got a struct that can't be mapped directly to GraphQL, that contains computed fields or circular structures, you have to use a more powerful tool: the `object` procedural macro. This macro lets you define GraphQL object -fields in a Rust `impl` block for a type. Continuing with the +fields in a Rust `impl` block for a type. Note that only GraphQL fields +can be specified in this `impl` block. If you want to define normal methods on the struct, +you have to do so in a separate, normal `impl` block. Continuing with the example from the last chapter, this is how you would define `Person` using the macro: