Skip to content

How to autoload types to graphql resolver #1427

Answered by ziimakc
ziimakc asked this question in General
Discussion options

You must be logged in to vote

It seems there is problem with path when using next.js, so solution is:

  typegenAutoConfig: {
    sources: [
      {
        alias: 'types',
        source: path.join(process.cwd(),  'backend', 'apollo', 'server.ts'),
      },
    ],
    contextType: 'types.Ctx',
  },

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ziimakc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant