Comments (12)
@phated I tried this on a new branch.
In addition, thank you very much for the support of async-graphql
. I was even more excited when I found out that you are the main maintainer of glup.js
.
from async-graphql.
The side effect is improved runtime performance.π
from async-graphql.
I'm not very happy with this idea.
from async-graphql.
If the interface field types do not match, there is now a panic at Schema::new
and a reason is given.
The following code didn't compile well before, but it does now.
struct MyObj;
#[Object]
impl MyObj {
async fn a(&self) -> &str {}
}
#[Interface(field(name = "a", type = "String"))]
struct MyInterface(MyObj);
This actually seems reasonable, it simplifies the definition of the interface.
from async-graphql.
Panic is not desirable. I believe there is a solution that involves traits but I'm unable to work on it currently.
from async-graphql.
Panic is not desirable. I believe there is a solution that involves traits but I'm unable to work on it currently.
@phated
Thanks for your suggestion.π I will make a version as soon as possible and see how it works.
from async-graphql.
@sunli829 is it possible to use a macro to add additional methods to a trait, including a default implementation? That is the solution I am considering.
from async-graphql.
@phated I'm actually hoping to solve this problem #29 and #28. I think procedural macros may not be possible.
from async-graphql.
I am hoping to find time to understand macros better, but my other open source responsibilities are requiring my time right now.
Tomorrow I am giving a presentation on async-graphql
and I wanted to show type safety on interfaces.
from async-graphql.
π Thank you! Your work on this project is amazing and I very much appreciate it! I am excited to help out more.
from async-graphql.
@sunli829 I think it is a great Idea especially when it panics at application start. I never really liked the implementation of Interface. I think it is somehow reversed. Isnβt there a more natural way where Interface behaves more like a trait? So that Objects and SimpleObjects can "implement" it rather than beeing passed into the interface as struct fields? It just feels wrong and doesnβt allow shareing an interface over crate boundaries.
@phated Is your presentation being recorded? I would love to see it.
from async-graphql.
@nicolaiunrein The interface definition is not natural, but it is simple enough to use.π
from async-graphql.
Related Issues (20)
- Access the value of "variable" arguments (`Value::Variable`)
- Has anyone does any benchmarks because im getting extremely poor results and I do not know why? HOT 8
- Get mutable referenece to the global data defined in the `Context` or `Schema` HOT 1
- Confusing `unused_mut` warning in `#[Object]` HOT 8
- How to handle both directions of one-to-many relation in federated graph
- Question: How to get server to send ping messages on subscriptions? HOT 2
- Parsing multiple operations in a file HOT 1
- Non nullable variables should allow default values HOT 3
- Object with single skipped field but with ComplexObject HOT 2
- As using proxy type
- Using flatten inside an impl with no other fields causes a compile error
- Subscription with MPSC receiver in context data
- Reduce clippy noise from #[Object] macro HOT 2
- Guard trait lifetime HOT 1
- Using generics with both SimpleObject and InputObject as field in output type fails HOT 1
- Subscription Authentication
- Stack overflow after upgrade to 7.0.2 HOT 3
- Does async-graphql validate responses?
- Error reading data from ExtensionContext after upgrade to 7.0.3
- Create a general error formateer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-graphql.