Skip to content

Need to add a use futures; statement to object derive w/ async feature. #534

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

Closed
thedodd opened this issue Feb 18, 2020 · 1 comment · Fixed by #541
Closed

Need to add a use futures; statement to object derive w/ async feature. #534

thedodd opened this issue Feb 18, 2020 · 1 comment · Fixed by #541
Labels
area::async Related to async/.await functionality bug Something isn't working

Comments

@thedodd
Copy link

thedodd commented Feb 18, 2020

Describe the bug
On the master branch, using the async feature, use of the derive macro #[juniper::graphql_object(...)] will cause a compilation error stating that futures is not in scope. Looks like this just needs a use futures; somewhere in the macro.

To Reproduce
Just pop a #[juniper::graphql_object(...)] on any valid struct with the async feature enabled, and don't use futures; anywhere in the module.

Expected behavior
Pretty common issue in macros. Just need to add a use statement.

@thedodd thedodd added bug Something isn't working needs-triage labels Feb 18, 2020
@samuela
Copy link
Contributor

samuela commented Feb 18, 2020

I think this might be why cargo test is failing on 547cf3e too:

error[E0432]: unresolved import `futures`
  --> integration_tests/juniper_tests/src/issue_398.rs:39:1
   |
39 | #[juniper::graphql_object]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type or module `futures`
   |
   = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

@LegNeato LegNeato added area::async Related to async/.await functionality and removed needs-triage labels Feb 21, 2020
LegNeato added a commit to LegNeato/juniper that referenced this issue Feb 21, 2020
Fixes graphql-rust#534.

I am not ure if the best way is to have folks bring their own futures for the
derives / macros or to pull it in as a dep explicitly like I have done here.

Because people are filing issues, we will do it this way and see what other issues arise.
LegNeato added a commit that referenced this issue Feb 21, 2020
Fixes #534.

I am not sure if the best way is to have folks bring their own futures for the
derives / macros or to pull it in as a dep explicitly like I have done here.

Because people are filing issues, we will do it this way and see what other issues arise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::async Related to async/.await functionality bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants