question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript errors in fresh graphql-auth example

See original GitHub issue

I am trying to evaluate prisma2 for a data model and having trouble getting started. The example project has a typescript error. Deleting those lines broke the app.

I created the example with npx, you can check the logs below:

console log
$ npx prisma2 init hello-prisma

 SUCCESS  The hello-prisma directory was created!
 SUCCESS  Prisma is connected to your database at file:dev.db

β”Œβ”€ Next steps ─────────────────────────────────────────────────────────────────────────────────────────────────────┐
β”‚                                                                                                                  β”‚
β”‚   Navigate into the project directory:                                                                           β”‚
β”‚   $ cd hello-prisma                                                                                              β”‚
β”‚                                                                                                                  β”‚
β”‚   Start Prisma's development mode to enable access to                                                            β”‚
β”‚   Prisma Studio and watch schema.prisma for changes:                                                             β”‚
β”‚   $ prisma2 dev                                                                                                  β”‚
β”‚                                                                                                                  β”‚
β”‚   Start the GraphQL server (in a new terminal window/tab):                                                       β”‚
β”‚   $ npm run dev                                                                                                  β”‚
β”‚                                                                                                                  β”‚
β”‚   Learn more about Prisma 2:                                                                                     β”‚
β”‚   https://github.com/prisma/prisma2/                                                                             β”‚
β”‚                                                                                                                  β”‚
β”‚   If you encounter any issues, please report them here:                                                          β”‚
β”‚   https://github.com/prisma/prisma-examples/issues/new                                                           β”‚
β”‚                                                                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


$ npx prisma2 dev

   Watching for changes in prisma/schema.prisma

   Watching for changes in prisma/schema.prisma

   Watching for changes in prisma/schema.prisma

   Watching for changes in prisma/schema.prisma
   Last changed at 2:47:50 PM


   Migrations
   ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 βœ“ Database successfully migrated
   To save changes into a migration file, run prisma2 lift save


   Generators
   ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 βœ“ Photon.js    Generated in 13.79s




Screen Shot 2019-11-12 at 15 21 43 Screen Shot 2019-11-12 at 15 21 49

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
alexsserbancommented, Nov 13, 2019

I can confirm this issue, a solution would be very nice.

2reactions
darknooncommented, Nov 26, 2019

Yes! That works for me, just add this block to your schema.ts:

…
  outputs: {
    typegen: __dirname + '/generated/nexus.ts',
    schema: __dirname + '/generated/schema.graphql',
  },
…

Autocomplete even works:

Screen Shot 2019-11-26 at 11 01 16
Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL error handling to the max with Typescript, codegen ...
All the code examples can be found in this repository. GraphQL Default Error Handling. In GraphQL, all requests must go to a single...
Read more >
Cannot find module '@prisma/photon' For Prisma 2 Typescript ...
Just git clone the latest prisma-examples Go to typescript/graphql-auth or graphql-apollo-server, run npm i Round 1 error:Β ...
Read more >
Securing Your Graph With Neo4j GraphQL
The schema contains CRUD resolvers that produce Cypher and are backed by a Neo4j instance. Once you have the schema, you can pass...
Read more >
Webpack Typescript errors on fresh Nestjs app - Stack Overflow
Webpack Typescript errors on fresh Nestjs app ... manager and executing yarn start or npm start my project throws the following errors:
Read more >
Authentication - How to GraphQL
One of the most common layers in a web applications is the authentication layer. Our app is no exception. For authentication, we are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found