Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on makeSchema/typegenAutoConfig #695

Closed
JulianaAmoasei opened this issue Dec 2, 2020 · 0 comments · Fixed by #711
Closed

Documentation on makeSchema/typegenAutoConfig #695

JulianaAmoasei opened this issue Dec 2, 2020 · 0 comments · Fixed by #711
Labels
type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...)

Comments

@JulianaAmoasei
Copy link

JulianaAmoasei commented Dec 2, 2020

I'm looking for documentation on the use of the sources property on typegenAutoConfig, but ended up with more doubts... The related page in the docs seems to be incomplete, as some sentences kind of end abruptly.

In the code below, I used the module @prisma/client as source for type generation, but for some reason the API still works either I declare sources or not. I'm not sure I understood how this property works and how to use it...

I'd be grateful if someone could clarify it for me!

const schema = makeSchema({
  types: [Query, Mutation, Post, User, Review],
  plugins: [nexusPrisma({ experimentalCRUD: true })],
  outputs: {
    schema: path.join(__dirname, 'schema.graphql'),
    typegen: path.join(__dirname, '../prisma/generated', 'nexus.ts'),
  },
  typegenAutoConfig: {
    sources: [
      {
        source: '@prisma/client',
        alias: 'prisma',
      },
    ],
  },
})
@jasonkuhrt jasonkuhrt added the type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...) label Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants