Reputation: 615
I am creating a custom directive based on the next documentation: https://www.apollographql.com/docs/apollo-server/v2/features/creating-directives.html#Enforcing-value-restrictions and a have a question about the comment "Replace field.type with a custom GraphQLScalarType th ...."
... visitFieldDefinition(field) { this.wrapType(field); } // Replace field.type with a custom GraphQLScalarType that enforces the // length restriction. wrapType(field) { if ( ...
The example creates a new GraphQLScalarType and replace the initial type, so I am losing the initianl Type (String, ID, etc)
How Can I use visitInputFieldDefinition without replaces the initial type? Is it posible to use method resolve? like in method visitFieldDefinition
Upvotes: 2
Views: 523
Reputation: 12281
Currently there is no resolve on input types, though it has been asked for.
Upvotes: 1