gatsby-uc / gatsby-uc/plugins

feat(gatsby-source-strapi): timeout setting for queries

Open
#447 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
57
Forks
37
PR merge metrics
No merged PRs in 30d

Description

## Is your feature request related to a problem? Please describe.
Hey guys, the team I'm working with needs a feature that allows us to change the timeout for queries to Strapi. We utilize Strapi as a website builder and have many sites in the CMS. We have a couple of very large sites with over 100 pages, and when the query takes 60 sec or longer we get a 504 timeout error coming from `[gatsby-source-strapi]/[axios]/lib/core/createError.js:16:15`

## Describe the solution you'd like
We'd like to be able to pass in our own timeout parameter for Strapi queries similar to how file fetching has the `GATSBY_STALL_TIMEOUT` env variable to alter the timeout settings (we've tried this and it doesn't work for our problem).

## Describe alternatives you've considered
We have looked through the code to see where the query timeout is being set to 60 seconds and we're not able to find it.

## Additional context
![Screen Shot 2023-07-28 at 11 13 33 AM](https://github.com/gatsby-uc/plugins/assets/88848580/3db4eb2a-d3f7-405c-abf9-16f059ce1d07)

Contributor guide

Open the contributing guide

Research direction

Start by tracing how gatsby-source-strapi creates Strapi queries and where axios applies its timeout; the issue points to axios/lib/core/createError.js:16:15 and contrasts this with GATSBY_STALL_TIMEOUT. Done means callers can provide a custom query timeout and long-running queries no longer fail at the fixed 60-second limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.