isInputType function
Returns true if type
can be used as a GraphQL input.
Implementation
bool isInputType(GraphQLType? type) {
return type != null &&
type.when(
enum_: (type) => true,
scalar: (type) => true,
input: (type) => true,
object: (type) => false,
union: (type) => false,
list: (type) => isInputType(type.ofType),
nonNullable: (type) => isInputType(type.ofType),
);
}