Abstract out logic to determining field type

Introduces a getFieldType function for determining a field's logical type
corresponding to the desired interface and behavior for query purposes.

Fix #391