Skip to content

Can we access to related fields in @Root ? #224

Answered by MaxiSantos
MaxiSantos asked this question in Q&A
Discussion options

You must be logged in to vote

Well.. don't know what to say. Now I can have access to relational fields in the @root object. Not sure why I counld't before. The only change I suspect is related is this

I use to use this

import {
  crudResolvers, relationResolvers, ResolversEnhanceMap,
  applyResolversEnhanceMap
} from '../generated/type-graphql';

const schema = await tq.buildSchema({
    resolvers: [
      ...crudResolvers,
      ...relationResolvers,
     other resolvers,
    ],
    authChecker: customAuthChecker,
    authMode: "error",
    validate: true,
    globalMiddlewares: [ErrorInterceptor],
  });

and now I have this

import {
  resolvers, ResolversEnhanceMap,
  applyResolversEnhanceMap
} from '../generated/ty…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

@MaxiSantos
Comment options

@MaxiSantos
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MaxiSantos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants