Closed davidgtu closed 6 months ago
You'll need to downgrade your typescript-resolvers dependency to 3.x (in fact, align all of them to 3.x if possible) as in 4.0 Scalars are defined as
export type Scalars = {
ID: { input: string; output: string; }
String: { input: string; output: string; }
Boolean: { input: boolean; output: boolean; }
Int: { input: number; output: number; }
...
If I want to use the 4.x version then what changes I have to do ?
If I want to use the 4.x version then what changes I have to do ?
You can start from this discussion and follow the issues related to it where suggestions have been made: https://github.com/dotansimha/graphql-code-generator/pull/9375#issuecomment-1603413081
Hi @davidgtu,
Your Scalars
type should also have input/output. For example:
export type Scalars = {
ID: { input: string, output: string };
String: { input: string, output: string };
Boolean: { input: boolean, output: boolean };
Int: { input: number, output: number };
Float: { input: number, output: number };
DataURL: { input: any, output: any };
Date: { input: any, output: any };
DateTime: { input: any, output: any };
Email: { input: any, output: any };
JSON: { input: any, output: any };
PhoneNumber: { input: any, output: any };
};
I think @graphql-codegen/typescript
should be bumped to v4 for it to work. Please try and let me know if it works
Here's an example repo with codegen setup which doesn't have this issue: https://github.com/eddeee888/graphql-server-template.
Please bump your package versions. I'm more than happy to re-open this issue if it's still a problem.
Which packages are impacted by your issue?
"@graphql-codegen/typescript-resolvers"
Describe the bug
I just recently added the
typescript-resolvers
plugin to my codegen config, and while it does what I need, it seems to also add my custom scalars to theResolversTypes
.The issue is that it seems to add an extra
['output']
property to these scalars. For example; I end up getting an error:Example:
Am I missing something from my config? Ideally I want to remove this weird
['output']
propertyYour Example Website or App
N/A
Steps to Reproduce the Bug or Issue
N/A
Expected behavior
Ideally, I want to not have this
['output']
generatedScreenshots or Videos
No response
Platform
graphql
version: "^16.7.1"Codegen Config File
Additional context
No response