Interface resolveType is not optional
See original GitHub issueIt should be possible to define:
export const UserError = interfaceType({
definition(t) {
t.string('id')
},
name: 'UserError',
})
But I get an error:
Argument of type '{ definition(t: InterfaceDefinitionBlock<"UserError">): void; name: "UserError"; }' is not assignable to parameter of type 'NexusInterfaceTypeConfig<"UserError">'.
Property 'resolveType' is missing in type '{ definition(t: InterfaceDefinitionBlock<"UserError">): void; name: "UserError"; }' but required in type '{ resolveType: AbstractTypeResolver<"UserError">; }'
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Abstract Types - GraphQL Nexus
This guide covers the topic of GraphQL Union types and Interface types. You will learn how Nexus ... resolveType field will be required,...
Read more >Unions and interfaces - Apollo GraphQL Docs
Unions and interfaces are abstract GraphQL types that enable a schema field to return ... All of a union's included types must be...
Read more >How to add a `resolveType` to GraphQL? - Stack Overflow
Only thing, I have no idea where to insert or execute the resolver function... I'm using graphql-tools and not apollo, if that helps....
Read more >Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >Union & Interface Types - Join Monster
... not contain the "$type" (as it was not requested in the GraphQL query), so we cannot yet reference it in resolveType ....
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
Well, I seem to have found it pretty quickly after all. Adding this to the config object of
makeSchema()
I’m getting this error now and wondering what the correct fix for it is. Does anyone have one?