hi there, i'm having trouble writing a query resol...
# orm-help
j
hi there, i'm having trouble writing a query resolver. i want to include data from a relationship, but can't figure out how. can someone point me in the right direction?
l
what kind of relationship is it?
c
Hey, https://www.prisma.io/tutorials/a-guide-to-common-resolver-patterns-ct08, i think this will help. Answering your question you can use Fragments…
👍 1
j
it's a type connected to another type, like this:
Copy code
type A {
  id: ID! @unique @id
}
type B {
  id: ID! @unique @id
  a: A
}
where entries of type
B
have the
a
property set with a connection to entries of type
A
c
j
i thought fragments might be the answer. i've just been having trouble finding consistency in the examples i've come across
that latest link latest looks promising
thanks for sharing!
c
your welcome. maybe this helps.
hehehe,
_
is in place of the
root
j
@Claudio Luciano thanks for that example. i'm trying to translate it into a format that's compatible with nexus syntax. i think i'm close, but i'm not sure about the usage of
_
and
root
in your example. are you familiar with nexus?
actually nevermind, i'm gettin traction here. thanks again for the assist!
c
no problem 😄