algolia / gatsby-plugin-algolia

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

Is it possible to run plugin to index queries without gatsby build? #75

Closed marceleq27 closed 3 years ago

marceleq27 commented 4 years ago

As in title, I mean I want to index query in development mode to check if it's working properly. Now I must run gatsby build. Is there a way to omit that?

Haroenv commented 4 years ago

What's the reason you can't run Gatsby build on development? Since we are listening to the onPostBuild event from Gatsby, I think if you make a custom Gatsby plugin you might be able to trigger that manually, however I'm not sure how that would be done since I haven't tried it myself. Worth asking on the Gatsby repo IMO.

marceleq27 commented 4 years ago

It's no problem to run gatsby build but im in quite big project and every build takes a few minutes and it's really hard to test it again and again. Maybe good idea is to add something like devMode which index to algolia on development? Idk, but anyway thanks for help 🙂

Haroenv commented 4 years ago

The problem is that some of the other plugins you can use also use the onPostBuild hook, and could add things to the graphql schema you want to query

marceleq27 commented 4 years ago

Maybe I'll try to fork repo in next few days, and see if there is a solution for this problem 😛

Haroenv commented 3 years ago

Feel free still to open a PR if this is behaviour you want, but for the time being I'll close the issue :)