Closed andrejohansson closed 4 years ago
Can you provide a full example that fails to compile, not only parts of the project? I cannot reproduce this issue with the information given here.
Here the full project in its current state, please do not publish (link expires after 1 download).
Thank you so much for your time.
I hand some time to investigate why this happens. Turns out the reason is quite simple đŸ™ˆ :.
WundergraphEntity
generates backend specific code (because of type system reasons…). That means depending on what backend is enabled for wundergraph the correct impl is generated. In your example there was no backend enabled, so no impl was generated. Enabling at least the postgres backend does fix the problem described in this issue. You need to change wundergraph = "0.1.2"
to wundergraph = { version = "0.1.2", features = ["postgres", "chrono"]}
(I've also added the chrono
feature, because you use chrono in your entities :wink:.
There were also other issues with your code, here is a full patch to make it compile.
Closed as this is expected behaviour, though I should maybe add better documentation somewhere.
Thank you so much, I suspected it was something trivial I was missing! Have a nice weekend!
Hi,
I'm trying to get your examples running, but for some reason it seems like the macros doesnt get applied and extends my types. Perhaps you see directly what I'm doing wrong/missing?
The only thing I have done different from your example is to break apart the content in different files/modules. But the have correct (what I think) imports etc between them.
Tried putting everything in the same file but still got the same error...
The error
My type implementation
My diesel type
QueryModifier
Query object