Is it possible to query the id of a relation inste...
# prisma-whats-new
c
Is it possible to query the id of a relation instead of nesting the relation? For example, User has one Foo. I would like to do this
Copy code
{
  User(...) {
    id
    fooId
  }
}
instead of this
Copy code
{
  User(...) {
    id
    foo {
      id
    }
  }
}
n
@cullan that's not possible. why do you want to do that? one thing you could do in this case in turn the query around
Copy code
{
  allFoos(filter: {user: {... } } ) {
    id
  } 
}
s
@cullan And if this is something you need, please adda a comment to the spec discussion here: https://github.com/facebook/graphql/issues/249
👍 1
c
I want to do it in the case where I am grabbing a User to plug into the initialState of a redux-form. My select input value is the id rather than an object.
I see the link in the github issue for how to transform the props with apollo client which will work well enough.
Thank you
n
Nice! 🙂