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.

Many Type is not defined.

See original GitHub issue

Describe the bug When types are generated the Maybe type is not included.

To Reproduce Steps to reproduce the behavior:

  1. Use the following config:
overwrite: true
schema: './src/schema.ts'
generates:
  src/types/generated.ts:
    - add: '// THIS IS A GENERATED FILE, DO NOT EDIT IT!'
    - 'typescript-server'
    - 'typescript-resolvers'
require:
  - ts-node/register
  1. Include typedefs & resolver and create executableSchema.
  2. Run codegen.

Expected behavior All types are correctly genereted except for the Maybe type, that one is missing.

Schema/Documents Ofcourse create an executableSchema from the following.

export const typeDefs: DocumentNode = gql`
  type Field {
    id: ID!
    testId: ID!
  }

  type Query {
    FieldsByTest: [Field!]
  }
`;

export const resolver = {
  Query: {
    FieldsByTest: (_) => {
      return [];
    },
  },
};

Environment:

  • OS: Mac OS 10.12.6
  • Codegen: ^0.15.2
  • Node: 10.14.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
thomasfedbcommented, Jan 14, 2019

In the config file above 'typescript-server'.

0reactions
thomasfedbcommented, Jan 15, 2019

I’m sure a PR would be appreciated @Pruxis. Shouldn’t be difficult.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Type is not defined" error on project build - vb.net
You need to make sure that the consuming project is targeting a .NET Framework version which is equal to or higher than the...
Read more >
Type '<typename>' is not defined - Visual Basic - Microsoft Learn
Ensure that the type definition and its reference both use the same spelling. · Ensure that the type definition is accessible to the...
Read more >
Type is not defined, even though it's defined
VS is indicating a class is not defined, even though the class is defined, the current import statement is present, and the reference...
Read more >
How to Fix Compile Error: User-defined Type Not Defined ...
User-defined type | not defined. First, let's try to understand we have encountered the error because something is. “not defined”.
Read more >
VB.Net Troubleshooting - Type <type-name> is not defined.
A common cause is a simple misspelling where the class name is used. ... Here the class name should have been ' OdbcConnection...
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