Has anyone here created a relay/connection-compati...
# orm-help
a
Has anyone here created a relay/connection-compatible API using Prisma and Nexus? I would love any advice offered, especially around querying and mutating connection edges.
r
Hey @Alvin Khaled 👋 We have an official Nexus plugin for this. It’s built in by default in the framework (
t.connection
) and it can easily be enabled in Nexus Schema. Unfortunately there’s no a proper GraphQL relay example for this.
a
Hey Ryan. I've successfully used
t.connection
for queries, but can
t.connection
be used for mutations? I'm trying to create mutations the return edges (for connections) as used in examples here and here. Also, can I configure prisma to use global IDs (I can provide the transformation functions) when it auto generates schema?
r
Hey Alvin, Did you try with UUID’s in
schema.prisma
as they would also fall into Global ID’s?
a
I haven't. Doesn't that imply I would need to use UUIDs in my database?
r
Yes as that could be uniquely identified
a
How would I be able to derive the graphql type given an ID if I did that? (Trying to support the
node
interface for relay)