Unable to build with-typescript-graphql example
See original GitHub issueBug report
Describe the bug
When running the command yarn build
on the with-typescript-graphql example, I receive the following error:
yarn run v1.22.4
$ yarn codegen && next build
$ graphql-let
[ graphql-let ] Running graphql-codegen...
✔ Parse configuration
[ graphql-let ] 1 .d.ts were generated.
Failed to compile.
./lib/resolvers.ts:1:10
Type error: Module '"*.graphqls"' has no exported member 'QueryResolvers'. Did you mean to use 'import QueryResolvers from "*.graphqls"' instead?
> 1 | import { QueryResolvers } from './type-defs.graphqls'
| ^
2 | import { ResolverContext } from './apollo'
3 |
4 | const Query: Required<QueryResolvers<ResolverContext>> = {
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To Reproduce
In terminal, run the following commands:
$ yarn create next-app --example with-typescript-graphql with-typescript-graphql-app
$ cd with-typescript-graphql-app
$ yarn build
Expected behavior
I expect the build to successfully complete
System information
- OS: macOS 10.15.6
- Version of Next.js: 9.5.2
- Version of Node.js: v12.18.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
with-typescript-graphql example does not build #32605 - GitHub
The example with-typescript-graphql does not build. Following error shows up: yarn run v1.22.17 $ yarn codegen && next build $ graphql-let ...
Read more >Integrate TypeScript with GraphQL using TypeGraphQL
Build an API to integrate TypeScript with GraphQL using the TypeGraphQL library, which simplifies creating GraphQL APIs in Node.js.
Read more >Generate GraphQL Types with Apollo Codegen Tutorial
In this post, you'll learn how to use Apollo's GraphQL codegen to generate TypeScript types for GraphQL operations in your Apollo Client ...
Read more >GraphQL error handling to the max with Typescript, codegen ...
Since we include the __typename and the fields match the Schema type definitions, there is no need to define type resolvers.
Read more >Failed to compile in React Typescript with graphql-typed ...
I'm trying out GraphQL codegen + graphql-typed-document-node. The examples provided by the library works (check out github link).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bradhaydon I feel a bit silly for finding this now, but apparently the creator of
graphql-let
already had their own PR for the example already :https://github.com/vercel/next.js/pull/16101
prolly worth a look if you like the graphql-let package.
I just tried your locally @RileyMShea and it worked perfectly. Thank you for your help, I really appreciate it!