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:
parent
f5e4b6b9b6
commit
15e9bffa84
1 changed files with 3 additions and 1 deletions
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in a new issue