Comments (6)
graphql-js has the utilities to parse & modify the query — https://graphql.org/graphql-js/language
You can see it in action here: https://astexplorer.net/#/gist/6741b9816f2a912253551d349096621d/5c732d8915bdc59ed75ecb6fd1838ea713a1478c
Happy to pair with you sometime on the implementation! I'd love to help y'all speed this up sooner than later as it's a slower part of many people's builds.
from gatsby-plugin-algolia.
As the user writes the query themselves, would you be thinking of somehow changing the query to add the contentDigest, or to recommend using that as the matchFields
by default in the readme/code?
Thanks for the suggestion @KyleAMathews!
from gatsby-plugin-algolia.
Yeah, you should rewrite the query to make sure it's always returning the contentDigest
. And then cache the node's id/contentDigest so that you can compare it with the next build. Then you can automatically only send data for nodes that are either a) new or b) changed. This would make indexing really fast most of the time as most builds only have ~1-10 nodes that have changed. I'm just now looking at a site on Gatsby Cloud that takes ~100s on every build to index to Algolia 😱
from gatsby-plugin-algolia.
Is there some way in Gatsby to transform the query? Trying to parse the query would be much too much work. If you have any idea how it could be implemented, the plugin is fairly simple, so I can review a PR you make @KyleAMathews :)
from gatsby-plugin-algolia.
Here's a little gist showing the basics of rewriting a query https://gist.github.com/KyleAMathews/a7342ebad8f8f0ea6938f61649358248
from gatsby-plugin-algolia.
Closed by #162 — thanks @Haroenv !
from gatsby-plugin-algolia.
Related Issues (20)
- Question re: Algolia Search HOT 6
- Unreachable hosts Error HOT 6
- Algolia transformer returns nulls for images that are correctly displayed in built site HOT 1
- Support for Gatsby 5 HOT 2
- Gatsby 4 build broken gatsby-plugin-algolia v1.0.0 HOT 2
- failed to index to Algolia Cannot read properties of undefined (reading 'contentDigest') HOT 3
- Plugin breaking in Gatsby 5 HOT 5
- JavaScript heap out of memory HOT 5
- Add indexName to the gatsby cache key HOT 4
- Why partial partial update is no more optional ? HOT 6
- Enrich your records with Google Analytics data HOT 1
- Request for skipIndexing Option to Avoid Unwanted API Access During CI Builds HOT 2
- Extracting chunks of long text as its own record HOT 2
- Adding headers to graphql query HOT 3
- Error: cannot apply the batch operation on a replica index
- Plugin is deleting Sanity document from index if edited. HOT 3
- Adding new data to existing records is ignored HOT 3
- Gatsby internal.contentDigest is a poor source for deciding whether content needs to be updated HOT 6
- Do we still need the MatchFields and enablePartialUpdate options in config? HOT 2
- Partially update not updating existing object in index HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-algolia.