Closed orblazer closed 2 years ago
Hello, I play with this plugin and after an reboot (without run gatsby clean) the static query type is not generated because action REPLACE_STATIC_QUERY is not called (logic because the query haven't change).
gatsby clean
REPLACE_STATIC_QUERY
I have try to find an way to fix it but the only action called on each time when build, when start develop, when update is SET_GRAPHQL_DEFINITIONS (definition : https://github.com/gatsbyjs/gatsby/blob/f43a6bd8ab3226afdfa79519d477c2a43f86e66d/packages/gatsby/src/redux/actions/internal.ts#L130).
when build
when start develop
when update
SET_GRAPHQL_DEFINITIONS
That return an object like :
{ components: Map(3) { '/data/.cache/dev-404-page.js' => { query: 'query PagesQuery {\n' + ' allSitePage(filter: {path: {ne: "/dev-404-page/"}}) {\n' + ' nodes {\n' + ' path\n' + ' }\n' + ' }\n' + '}\n', componentPath: '/data/.cache/dev-404-page.js', pages: [Set], isInBootstrap: true }, '/data/src/pages/404.tsx' => { query: '', componentPath: '/data/src/pages/404.tsx', pages: [Set], isInBootstrap: true }, '/data/src/pages/index.tsx' => { query: '', componentPath: '/data/src/pages/index.tsx', pages: [Set], isInBootstrap: true } }, staticQueryComponents: Map(1) { 'sq--src-hooks-use-site-metadata-ts' => { name: 'SiteMetadata', componentPath: '/data/src/hooks/use-site-metadata.ts', id: 'sq--src-hooks-use-site-metadata-ts', query: 'query SiteMetadata {\n' + ' site {\n' + ' siteMetadata {\n' + ' siteUrl\n' + ' title\n' + ' description\n' + ' }\n' + ' }\n' + '}\n', hash: 227279697 } } }
For now the only way to fix it its to run gatsby clean before run gatsby develop
gatsby develop
Thanks.
This is fixed in v3. (currently rc)
v3 relies on SET_SCHEMA and SET_GRAPHQL_DEFINITIONS, which is much more stable. Thanks @orblazer
SET_SCHEMA
Hello, I play with this plugin and after an reboot (without run
gatsby clean
) the static query type is not generated because actionREPLACE_STATIC_QUERY
is not called (logic because the query haven't change).I have try to find an way to fix it but the only action called on each time
when build
,when start develop
,when update
isSET_GRAPHQL_DEFINITIONS
(definition : https://github.com/gatsbyjs/gatsby/blob/f43a6bd8ab3226afdfa79519d477c2a43f86e66d/packages/gatsby/src/redux/actions/internal.ts#L130).That return an object like :
For now the only way to fix it its to run
gatsby clean
before rungatsby develop
Thanks.