Is there a way to add a field along with the `info...
# orm-help
m
Is there a way to add a field along with the
info
object in prisma-binding? Basically, always add a field that should be grabbed regardless of the
info
object's contents.
m
Hey, Michael, can you elaborate a little more about the functionality you are trying to implement and its intended application? Like, in a practical sense?
m
So basically, I am re-implementing the old
me
from graphcool. Along with whatever fields I am trying to grab from
me
I would also always like to make sure the
securityToken
field is grabbed as well. So for example, if I did
me { id name }
I would like it to append the
securityToken
to that in the resolver, so it would grab
me { id name securityToken }
. Simply, I am just trying to always add on a static field to the info object inside of the resolver.
@medelman Any ideas? 🙂
m
Hey, sorry about the delay. This looks like a good case for a custom type that wraps the type you want to return and includes the extra bit of data.
Copy code
type UserWithCreds {
    user: User!
    cred: String!
}
m
@medelman Ahh good idea, thank you 🙂