Comments (2)
In my opinion @mkmarek shouldn't integrate Relay specific stuff into this project, since there are more GraphQL clients than Relay. It also deviates this project from the graphql-js reference implementation. I'd rather see an companion project target on Relay that implemented the all specific requirements for it. Facebook is also working actively on Relay 2 where they possibly could introduce breaking changes for the server-side requirements, and a project that implements the Relay specific implementation should support both Relay 1 and 2.
The node
field is something you can do yourselves, like I have done. Just add a field named node
to your root query and add a custom resolver where you deconstruct the global id e.g. ClrType.FullName:IdOfInt32
. This allows you to figure out what type Relay ask for and what the actual id of the item is. Based on that info you should be able to resolve item and return the correct object.
One tip I have for you: I have implemented the resolvers for the complex types in separate classes, and I have a mapping for my GraphQLTypes and corresponding resolvers. In the resolve method of the node
field, I extract the CLR type out of the given global id and then I use the mapping to find the resolver I need to invoke.
from graphql-dotnetcore.
Sounds absolutely right! Thanks for the good post!
If I end up using dotnetcore, it'll probably be using graphql-dotnet since it seems more active and already has Relay support.
The syntax is very verbose compared to this, but it has a lot more features so far. Thanks for your response!
from graphql-dotnetcore.
Related Issues (20)
- Implement graphql subscriptions HOT 1
- Validation ast visitor should support introspection types HOT 1
- Implement GraphQL union types HOT 1
- Parser Collaboration HOT 3
- Support for nullable enums
- Fix null variables
- Migrate build process to MSBuild.net Core
- Add GraphQLID scalar type HOT 1
- Unique directives per location validation rule HOT 1
- Resolve type validation on subscriptions HOT 1
- Single Field Subscriptions validation rule HOT 1
- Add location information to graphql errors HOT 1
- Add path information to graphql errors HOT 1
- Better subscription support and demo HOT 1
- Initial support for @defer, @stream, and @live
- Create possibility to set description to to field in GraphQLObject HOT 1
- Create possibility to deprecate field HOT 1
- Create possibility to specify default value for field arguments HOT 1
- Example working with EF Core HOT 3
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 graphql-dotnetcore.