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.

Unable to build with-typescript-graphql example

See original GitHub issue

Bug 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:

  1. $ yarn create next-app --example with-typescript-graphql with-typescript-graphql-app
  2. $ cd with-typescript-graphql-app
  3. $ 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RileyMSheacommented, Aug 17, 2020

@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.

1reaction
bradhaydoncommented, Aug 17, 2020

I just tried your locally @RileyMShea and it worked perfectly. Thank you for your help, I really appreciate it!

Read more comments on GitHub >

github_iconTop 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 >

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