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>
This commit is contained in:
Félix Gagnon-Grenier 2020-03-04 11:58:52 -05:00 committed by GitHub
parent f5e4b6b9b6
commit 15e9bffa84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,9 @@
If you've got a struct that can't be mapped directly to GraphQL, that contains 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: computed fields or circular structures, you have to use a more powerful tool:
the `object` procedural macro. This macro lets you define GraphQL object 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 example from the last chapter, this is how you would define `Person` using the
macro: macro: