To allow connecting ports of different types, for example an int port to a float port:
Graph.IsConnectionAllowed().output.DataType == typeof(int).input.DataType == typeof(float).Refer to the full example in the IsConnectionAllowed API reference.