typesense / gatsby-plugin-typesense

A Gatsby plugin to automatically index content to Typesense post-build
Apache License 2.0
34 stars 11 forks source link

Plugin only works with string field type #2

Closed nonapod closed 3 years ago

nonapod commented 3 years ago

Description

Working with int32, int64, float and bool fields throw an error on build as values are being extracted from the page and submitted as strings.

Steps to reproduce

Set up a simple Gatsby instance, add a basic page with float and int types on it and execute a build job. A typesense error should throw a type error complaining that an int32, int64, float or boolean field is required.

Expected Behavior

The page should index with the relevant types.

Actual Behavior

The page won't index because of type errors, even if a correct bool, float, int32 or int64 value is present, the build will finish prematurely. This is because the json request is forwarding extracted values as strings without casting to the correct types.

Metadata

Typsense Version: 0.1.0

OS: Ubuntu 18.04.3 LTS