TypeError when using AuthorizePlugin
See original GitHub issueTS2345: Argument of type '{ type: NexusObjectTypeDef<"GroupCategory">; description: string; args: { name: NexusArgDef<"String">; }; authorize: () => boolean; resolve(parent: any, args: any, { database, tenant }: Context): Promise<...>; }' is not assignable to parameter of type 'NexusOutputFieldConfig<"Mutation", "createGroupCategory">'. Object literal may only specify known properties, and 'authorize' does not exist in type 'NexusOutputFieldConfig<"Mutation", "createGroupCategory">'.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TypeError when using AuthorizePlugin · Issue #511 - GitHub
Given your TS error, it looks like the authorize property is not known at all by TS. Are you sure you've enabled the...
Read more >Unexpected TypeError when using reduce function
2 Answers 2 ... The list function cannot be used because it corresponds to a type conversion which is not possible as your...
Read more >Typeerror: str object is not callable – How to Fix in Python
The result was the TypeError: 'str' object is not callable error. This is happening because we are using a variable name that the...
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 Free
Top 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
@chareice A quick fix I have found is to copy-paste this snippet into your project:
You could also try to use Nexus built-in
typegen
and the error should vanish:https://nexusjs.org/docs/api/make-schema#shouldgenerateartifacts-outputs-typegenautoconfig
Indeed, my bad I wrote my comment before making further investigations about this 🤡 I found a solution in case of someone looking for a fix. I added this to
tsconfig.json
And now it works for me 😃