Open outerlook opened 4 years ago
Hey @outerlook have you looked at https://www.nexusjs.org/#/api/modules/main/exports/schema?id=tconnection.
I'm also in the process of implementing a Relay-compliant GraphQL server using Nexus (@nexus/schema only to be more specific), and I have been creating a few plugins to help with that, you can find them here https://github.com/JCMais/nexus-plugins
@JCMais fyi @Weakky just worked on this area. You two should talk :)
What
Is there any available example of building common features that are compliant to relay server spec with nexus?
Why
I'm trying to migrate my frontend to relay for some perf/structure issues, then I'm getting some hard time figuring out how to make somethings work, (pagination, global identification, separated input Objects, Mutation payloads). There are information about this but too spread out there, and I don't know if I'm not searching well, but I didn't find any example that uses prisma or nexus generating a relay compliant server.
I read the docs where there's info about how to use connectionField. There are some parts that would be really nice to understand where did something come from as
ctx.users.resolveForConnection
for example, and how different case my server is.How
Here's a gist showing how I implemented some parts, which I've not even tested, just to keep this available if some of it is useful https://gist.github.com/outerlook/c88a98335f976bba0a51db9de135f0c5
I really appreciate your work. Thank you