algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

Accounts for replica indices #51

Closed Bruce773 closed 4 years ago

Bruce773 commented 4 years ago

The basic premise of this issue was that I kept getting an error saying A replica index is already replica of another index whenever I tried to pass queries into this plugin that contained a replicas array within their settings object.

I found that a solution was to prevent the plugin from trying to attach replica indices to a _tmp index.

I also found that in indexExists, error.status needed to be switched to error.statusCode... apparently error.status was not returning an accurate status code...

I also found that forwardToReplicas was not supported... so, I implemented a quick solution to pass it through to Algolia. In the future, I'm assuming other modifiers will need to be added... So, I created an extraModifiers object to allow for additional property additions, later on.

Fixes: https://github.com/algolia/gatsby-plugin-algolia/issues/49

Bruce773 commented 4 years ago

@Haroenv Should be good to go! :)

Haroenv commented 4 years ago

This is released in 0.7.0