Fixed getting "custom attribute panicked" message when using `[#Object]` helper. #409
This commit is contained in:
parent
610fe21536
commit
361d8d049f
|
@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.5.3] - 2021-02-13
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed [#409](https://github.com/async-graphql/async-graphql/issues/409)
|
||||
|
||||
## [2.5.2] - 2021-02-06
|
||||
|
||||
### Added
|
||||
|
|
|
@ -63,6 +63,14 @@ pub fn generate(
|
|||
let mut create_ctx = true;
|
||||
let mut args = Vec::new();
|
||||
|
||||
if method.sig.inputs.is_empty() {
|
||||
return Err(Error::new_spanned(
|
||||
&method.sig,
|
||||
"The self receiver must be the first parameter.",
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
for (idx, arg) in method.sig.inputs.iter_mut().enumerate() {
|
||||
if let FnArg::Receiver(receiver) = arg {
|
||||
if idx != 0 {
|
||||
|
@ -253,6 +261,14 @@ pub fn generate(
|
|||
let mut create_ctx = true;
|
||||
let mut args = Vec::new();
|
||||
|
||||
if method.sig.inputs.is_empty() {
|
||||
return Err(Error::new_spanned(
|
||||
&method.sig,
|
||||
"The self receiver must be the first parameter.",
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
for (idx, arg) in method.sig.inputs.iter_mut().enumerate() {
|
||||
if let FnArg::Receiver(receiver) = arg {
|
||||
if idx != 0 {
|
||||
|
|
Loading…
Reference in New Issue