use of com.graphql_java_generator.annotation.GraphQLInputType in project graphql-maven-plugin-project by graphql-java-generator.
the class QueryField method isScalar.
/**
* Indicates whether this field is a scalar or not.
*
* @return true if this field is a scalar (custom or not), and false otherwise.
* @throws GraphQLRequestPreparationException
*/
public boolean isScalar() throws GraphQLRequestPreparationException {
if (scalar == null) {
// The scalar value has not yet been calculated.
// All the generated classes have a GraphQL annotation.
// If no such annotation, then this type is a scalar.
GraphQLInputType graphQLInputType = clazz.getAnnotation(GraphQLInputType.class);
GraphQLInterfaceType graphQLInterfaceType = clazz.getAnnotation(GraphQLInterfaceType.class);
GraphQLObjectType graphQLObjectType = clazz.getAnnotation(GraphQLObjectType.class);
GraphQLQuery graphQLQuery = clazz.getAnnotation(GraphQLQuery.class);
GraphQLUnionType graphQLUnionType = clazz.getAnnotation(GraphQLUnionType.class);
// If one of these annotations is not null, then it's not a scalar. Otherwise, this type is a scalar.
scalar = !(graphQLInputType != null || graphQLInterfaceType != null || graphQLObjectType != null || graphQLQuery != null || graphQLUnionType != null);
}
return scalar;
}
Aggregations