Coder Social home page Coder Social logo

Support Relay about juniper HOT 14 OPEN

graphql-rust avatar graphql-rust commented on August 15, 2024 7
Support Relay

from juniper.

Comments (14)

dyedgreen avatar dyedgreen commented on August 15, 2024 7

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.

bbqsrc avatar bbqsrc commented on August 15, 2024 2

I have started working on relay support, implementing the Relay Cursor Connections Specification specification here.

from juniper.

UkonnRa avatar UkonnRa commented on August 15, 2024 2

So any progress on Relay?

from juniper.

Asone avatar Asone commented on August 15, 2024 2

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.

dyedgreen avatar dyedgreen commented on August 15, 2024 1

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.

kaushalyap avatar kaushalyap commented on August 15, 2024

@bbqsrc can we now use relay with Juniper? any updates?

from juniper.

LegNeato avatar LegNeato commented on August 15, 2024

FWIW, I found https://github.com/bbqsrc/juniper-relay. @bbqsrc can speak to the state of it of course.

from juniper.

MonsieurMan avatar MonsieurMan commented on August 15, 2024

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:

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.

MonsieurMan avatar MonsieurMan commented on August 15, 2024

@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.

davidpdrsn avatar davidpdrsn commented on August 15, 2024

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.

MonsieurMan avatar MonsieurMan commented on August 15, 2024

from juniper.

davidpdrsn avatar davidpdrsn commented on August 15, 2024

I guess that means someone can build a library crate for relay support?

from juniper.

Asone avatar Asone commented on August 15, 2024

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.

IvanRodriCalleja avatar IvanRodriCalleja commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.