Skip to content

rogersp/apollo-codegen-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

This project demonstrates a typescript compilation issue that occurs when compiling types generated by apollo client:codegen when the following are true:

  • Typescript compiler is version 3.7 or above
  • The named mutation matches the called mutation (see UpdateBookMutation.ts)

Prerequisites

Apollo should be installed globally.

  • yarn global add apollo

Start local graphql server

  • cd server
  • yarn
  • yarn start

Generate client types

  • cd client
  • yarn
  • yarn gql:gen
  • yarn build <- this is where error occurs

The exact error message is:

error TS2440: Import declaration conflicts with local declaration of 'UpdateBook'.

About

Demonstrate typescript compilation issue after codegen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published