[nexus] why when i defined resolver for a field, i...
# orm-help
t
[nexus] why when i defined resolver for a field, it is no longer available in root?
Copy code
import { objectType } from '@nexus/schema'

export const User = objectType({
    name: 'User',
    definition(t) {
        t.model.id()
        t.model.email({
            resolve: async (root, args, ctx, info, originalResolve) => {
                const isAuthorized = await ctx.authorization.byUserId.load(root.id)
                return isAuthorized ? originalResolve(root, args, ctx, info) : null
            },
        })
        t.model.profile()
        t.model.balance({
            resolve: async (root, args, ctx, info, originalResolve) => {
                const isAuthorized = await ctx.authorization.byUserId.load(root.id)
                return isAuthorized ? originalResolve(root, args, ctx, info) : 0
            },
        })
    },
})

export * from './mutation'
export * from './query'
as you can see the
root
has
email
in it
but after i define the resolver, the email is gone
i try to log the root, turn out email is available in it