Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor object proc macro attributes to support parameter attributes #421

Closed
theduke opened this issue Aug 29, 2019 · 5 comments
Closed
Assignees
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer

Comments

@theduke
Copy link
Member

theduke commented Aug 29, 2019

Function parameter attributes are getting stabilized with 1.39. (see rust-lang/rust#60406 (comment)).

This means we can refactor the argument customization of the object proc macro.

This is currently awkward due to the lack of above feature ( see https://graphql-rust.github.io/juniper/current/types/objects/complex_fields.html#customizing-arguments ).

  • Supported arguments: #[graphql(rename = "...", default = expr, description = "...")]
  • Old style should remain supported for now but with a deprecation warning (simple println in the macro)
  • can be implemented right now with a feature flag, which can be removed once 1.39 is released
@davidpdrsn
Copy link
Contributor

I have started hacking in this. Progress is here https://github.com/davidpdrsn/juniper/tree/parameter-attributes

@theduke
Copy link
Member Author

theduke commented Oct 21, 2019

@davidpdrsn awesome, please ask if you have any questions.

Also feel free to open a draft PR to give it visibility.

@tyranron
Copy link
Member

tyranron commented Oct 6, 2020

In #682 landed the implementation for GraphQL interfaces.

tyranron added a commit that referenced this issue Aug 11, 2021
- preserve and reuse defined impl blocks in #[graphql_object] and #[graphql_subscription] macros expansion
- allow renaming `ScalarValue` type parameter in expanded code via `scalar = S: ScalarValue` syntax

Additionally:
- rename `rename` attribute's argument to `rename_all`
- support `rename_all` in #[graphql_interface] macro
@tyranron
Copy link
Member

In #971 landed the implementation for GraphQL objects and subscriptions.

@tyranron tyranron added k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer and removed help wanted good-first-issue labels Aug 11, 2021
@tyranron tyranron self-assigned this Aug 11, 2021
@c410-f3r
Copy link
Contributor

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants