Comments (14)
I've moved the Relay connection package into it's own repo and published that on crates.io. (I also added an async version, so the load closure may be async ...) (cc @Asone)
from juniper.
I have started working on relay support, implementing the Relay Cursor Connections Specification specification here.
from juniper.
So any progress on Relay?
from juniper.
Just for information, digging on with Github search i found an implementation that seems to work made by @dyedgreen on a rust project he made. The implementation can be found here.
I don't know if he intends at some point to publish this as a separate crate, but meanwhile it could be useful to anyone that would like to use relay pagination.
Also, his code uses the implementation so it provides a good example on how to use it
from juniper.
If people find it useful, I could try to update the library if necessary and publish it as a stand-alone crate.
I made this a while ago, but iirc it’s mostly just a trait that you can implement which then gets plummed through to the correct Juniper traits.
from juniper.
@bbqsrc can we now use relay with Juniper? any updates?
from juniper.
FWIW, I found https://github.com/bbqsrc/juniper-relay. @bbqsrc can speak to the state of it of course.
from juniper.
There is a specification page about the assumptions Relay makes of a GraphQL server. https://relay.dev/docs/en/graphql-server-specification, work could begin from there.
Those three points are further detailed and linked at the end of the page, https://relay.dev/docs/en/graphql-server-specification#further-reading:
- Global unique IDs + a few more things
- Connection modeling of paged entities, the same way github and others models pagination for entities.
- Using a mutationID for mutation inputs
From my understanding, any implementation of a GraphQL server can work as a Relay server, you just have to check a few other things. There is maybe an opportunity to check them at compile time with Rust but this is not to be added directly into juniper IMO.
from juniper.
@UkonnRa see my comment above. You can use it, you just have to check a few things manually and to conform to the three specs I linked to.
from juniper.
I wonder if the relay additions could be a separate library built on top of juniper and not necessarily something that is built in 🤔
from juniper.
from juniper.
I guess that means someone can build a library crate for relay support?
from juniper.
If people find it useful, I could try to update the library if necessary and publish it as a stand-alone crate.
I made this a while ago, but iirc it’s mostly just a trait that you can implement which then gets plummed through to the correct Juniper traits.
For my own use i just made a copy of your implementation mentioning the source.
However if you intend to publish it as a crate i'd be happy to use it as a dependency 😀.
I can't speak for all but i'm pretty sure people would find it useful as even if it is a few traits and structs, it might be not so trivial to many as no other implementation ( aside of @bbqsrc's one ) can be found on GH.
from juniper.
How do you support Global ID with Juniper?
having the node query:
node(id: "") {
id
... on Model {
name
}
}
I can't think in a good way to resolve this node
query to get the exact model resolver. I have seen in other language implementations that the id has a shape like: model-id
an then converted to uuid with that when the node
query is requested deserialize that and uses the model
to resolve.
How do you implement this resolver?
from juniper.
Related Issues (20)
- string mangling on dynamic schema due to smartstring dependency HOT 5
- Rust 1.67 emitting schema non-utf-8 field names HOT 3
- Generated code fails the `clippy::str_to_string` lint HOT 3
- Interface not working as expected with imlp HOT 3
- Expected query, got subscription. HOT 3
- `juniper_actix` does not compile with the `subscription` feature enabled HOT 2
- Old version of book is still online HOT 1
- operation_name not being set in juniper_hyper library HOT 2
- I'm having issues with App Data configuration
- Looking for Help & Community HOT 2
- `juniper_warp::make_graphql_filter` improperly returns 4xx on some `context_extractor` 5xx errors HOT 5
- Gitter link resolves to 404 HOT 1
- A better way to keep graphiql updated HOT 1
- Example to integrate with Axum HOT 7
- Subscription argumennt Error using juniper_graphql_transport_ws HOT 2
- GraphQLInputObject macro fails if crate has a local type alias named "Result"
- Create new release HOT 7
- expected tuple struct or tuple variant, found function `Ok` HOT 2
- Input type, determine if key set or unset HOT 2
- `#[graphql_object]` hides syntax errors HOT 2
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 juniper.