Jonathan
12/02/2020, 12:46 PMt.field
. I sometimes have a parent fetching basically all properties for all the nested resolvers, but I dont wish to specify an explicit resolver bellow. If I were to do something like
t.field('nestedField', { type: NestedFieldType, resolve: (parent => parent.nestedFieldType)})
, typescript complains that parent has no property nestedFIeldRyan
12/02/2020, 12:58 PMJonathan
12/02/2020, 1:04 PMexport interface NexusGenRootTypes {
ParentType: prisma.parentType,
etc..,
}
this is why I dont get nestedField as suggestion (but I do get nestedFieldId
from prisma). I suppose I should somehow disable this functionality of nexus, and ensure that the generated types matches the objectType I defined rather than use Prisma as backing type, though I cant figure out how I enabled it intially (basically, to get the following)
ParentType: {
nestedField: etc
}
Jonathan
12/02/2020, 1:06 PMVictor
12/10/2020, 5:56 PMUser.fieldA
that's part of the User model, but I don't want to expose it through GraphQL so I don't add it as a field with nexus. However, a side effect of this is that Nexus has no clue that fieldA
even exists. The issue here is that I do need to be able to retrieve this value, but it's not typed.
There is some documentation on how you can add your own backing types here; https://nexusjs.org/docs/adoption-guides/nexus-framework-users#backing-types-type-discovery