private Optional < OperationTypeDefinition > synthOperationTypeDefinition ( Function < Type , Optional < ObjectTypeDefinition > > typeReteriver , String opName ) { TypeName type = TypeName . newTypeName ( ) . name ( capitalize ( opName ) ) . build ( ) ; Optional < ObjectTypeDefinition > typeDef = typeReteriver . apply ( type ) ; return typeDef . map ( objectTypeDefinition -> OperationTypeDefinition . newOperationTypeDefinition ( ) . name ( opName ) . typeName ( type ) . build ( ) ) ; }
looks for a type called Query|Mutation|Subscription and if it exist then assumes it as an operation def