-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Database Sync impl missing inside Juniper schema #1157
Comments
You might also look at https://github.com/davidpdrsn/graphql-app-example as an example of juniper in rocket. Unfortunately I haven't yet put the time in to try working with juniper, and there's enough generated code involved that I can't seem to figure anything out from looking at the docs, either. |
@jebrosen Thanks for the example, that's a very different approach. I haven't tried running it, because I the example I linked above is more similar to my code and already runs. The biggest difference in your example is that the GraphQL |
Sorry that example didn't help after all. One thing you seem to be doing differently from the example you posted has to do with the |
@y0hy0h It's been awhile since I've experimented with GraphQL via Juniper. I should probably update my example now that they've expanded their use of procedural macros. I don't have time to look into it right now as I'm at work, but I'll try to provide more support this evening. My initial guess is that their procedural macro doesn't take something into account that my example isn't affected by since I constructed the |
The type was not detected as thread-safe, which made Rocket abort compilation. See rwf2/Rocket#1157.
@jebrosen The pub struct Mutation;
#[juniper::object(Context=Store)]
impl Mutation {} then it compiles. So this definitely looks like an issue with Thanks a lot for all you kind help! |
Using
rocket = "0.4.2"
. Bug reproduced on Windows 10 and Elementary OS (Ubuntu-based). I've tested on multiple nightly versions.I'm encountering a bug that appears very similar to #578. Unfortunately, I don't understand what to do about it from their last comment.
I'm trying migrate a ReST API to GraphQL, for which I employ
juniper
. It's backed by a SQLite database accessed throughdiesel
, for which I userocket
's integration. However, the code refuses to compile, because theSchema
type that I need to pass tojuniper
is not deemed thread-safe:This is one of 9 errors, all being about a missing
Sync
impl that can be traced back torocket::State
's requirements. The full code is available at https://github.com/Y0hy0h/lindyhop-aachen/tree/bcbc0f02b62e10db2cdf73ae4deb194fe7f6c19a.Curiously, I can run https://github.com/ELD/rocket-juniper-example just fine after copying the dependencies from my code into their
Cargo.toml
. But I can't figure out what I did differently than them. I use theDatabase
struct instead of theSqliteConnection
in theContext
just as them, and I request theDatabase
andState<Schema>
as they do.I hope this is the right place to open this issue. Maybe you can point me to where the problem may lie.
The text was updated successfully, but these errors were encountered: