Nick Luger
02/22/2018, 5:36 PMid
of my parent, even if info
did not contain an id
. How can i determine the identity of the father? For example if info is { profile { posts { title, publicComments } } }
, how can i use the missing id
of the given post
to resolve publicComments
?nikolasburk
id
you’re looking for is in the first resolver argument (usually called root
or parent
) and not in in the info
bojectlawjolla
02/22/2018, 6:18 PMlawjolla
02/22/2018, 6:18 PMnikolasburk
Nick Luger
02/22/2018, 6:28 PMparent
), if the info
object passed in the fathers resolver did request an id
. I can run a query like { father { id { children}}
or i can run a query {father {children}}
(omitting id
). Now when the child-resolver is invoked, ther is no id in the parent
.matic
02/22/2018, 7:12 PMinfo
.Nick Luger
02/22/2018, 7:17 PMinfo
, by passing the original info
query and always add the id
field to the info
object? (The info object is a bit opaque to me, until now i used strings to describe it)matic
02/22/2018, 7:51 PMNick Luger
02/23/2018, 6:37 AMfragment: 'fragment PublicPosts on User { id }', resolve: (...) => ...)
. Now the id is always in the parent, no matter the info object provided by the client.Nick Luger
02/23/2018, 6:40 AMmatic
02/23/2018, 7:14 AMmatic
02/23/2018, 7:15 AMNick Luger
02/23/2018, 7:55 AM"prisma-binding": "1.5.12"
and "graphql-yoga": "1.3.3"
which uses "graphql-binding": "1.2.2",
for what i found.Nick Luger
02/23/2018, 8:32 AMNick Luger
02/23/2018, 8:33 AMNick Luger
02/23/2018, 8:33 AM... on User {
id
}
matic
02/23/2018, 1:08 PM