Skip to content

graphql_query_derive: support deriving for input variables as well #109

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

Merged
merged 1 commit into from
Sep 15, 2018

Conversation

mathstuf
Copy link
Contributor

This just hijacks the reponse_derives attribute right now since it
controls derives for generated data structures and Variables shares
much of that.

Fixes #103.


Should response_derives be renamed to extra_derives since it now applies to every generated type?

.split(',')
.map(|s| s.trim())
.map(|s| Ident::new(s, Span::call_site())),
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we derive the same traits as for the response at the moment, that seems like a good start. I think we might want to enable users to choose different derives for variables and ResponseData (since the use cases are different) in the future, but it's a good start. Great!

@tomhoule
Copy link
Member

I'll happily merge after the branch is rebased :)

@tomhoule
Copy link
Member

I'll also document it in the changelog.

This just hijacks the `reponse_derives` attribute right now since it
controls derives for generated data structures and `Variables` shares
much of that.

Fixes graphql-rust#103.
@mathstuf
Copy link
Contributor Author

Rebased and changelog entry added.

@tomhoule tomhoule merged commit 9a0bce4 into graphql-rust:master Sep 15, 2018
@mathstuf mathstuf deleted the derive-for-inputs branch September 15, 2018 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants