Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
GraphQL Code Generator not generating code in Next.js

I've got a codegen.yml that looks as follows:

overwrite: true
schema: http://localhost:3001/graphql
documents: "./src/graphql/**/*.graphql"
generates:
./src/generated/graphql.tsx:
  plugins:
    - typescript
    - typescript-operations
    - typescript-react-apollo
  config:
    withHooks: true

I have a script in the package.json that looks as follows:

  "scripts": {
    ...
    "generate": "graphql-codegen"
  }

This is my folder structure:

- root
     - package.json
     - codegen.yml
     - src
         - generated
         - graphql
            - mutations
               - login.grahql
            - queries

The login.grahql looks as follows:

query{
  user{
    username
    createdAt
    email
    id
    isLoggedIn
    fullName
    firstName
    lastName
  }
}

When I run

$ yarn generate

I get

yarn run v1.22.10
$ graphql-codegen
Done in 12.10s.

But I don't see any generated code. I was following the docs. What may be possibly my problem.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!