Fix query api for custom primary key name.

Fixes #142
Merge pull request #143 from Shopify/non-id-pk

Fix query api for custom primary key name.