Skip to content
Discussion options

You must be logged in to vote

@dotansimha and anyone else trying to get fully typed datasets in next.js

I finally found a way to do this in Next. I used quite a bit of time on the "Typescript Apollo Nextjs" plugin, and although it offers a lot of extra ways to set up the file(s) it also offers A LOT of extra complexity.

Most developers will probably be better of just using TypedDocumentNode in most simple cases.

Here is HOW I got it working:

//codegen.yml

overwrite: true 
schema: "https://headless.traderrookie.com/graphql/"
documents: "./src/data/**/*.graphql"
generates:
  ./src/graphql-operations.ts:
    plugins:
      - typescript
      - typescript-operations
      - typed-document-node

Here is an example page co…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@dotansimha
Comment options

@LarsEjaas
Comment options

@dotansimha
Comment options

@LarsEjaas
Comment options

@dotansimha
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by LarsEjaas
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