You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(gatsby): Find identifiers only in the first argument when extracting queries from useStaticQuery (#14362)
* Find identifiers only in the first argument when extracting queries from useStaticQuery.
Previously it traversed the whole CallExpression for identifiers and it was picking up identifiers used as type parameters.
Fixes#14345.
* Added unit tests for useStaticQuery when first argument is a variable.
* Renamed tests to be consistent.
@@ -994,6 +1236,24 @@ We were unable to find the declaration of variable \\"strangeQueryName\\", which
994
1236
Perhaps the variable name has a typo?
995
1237
996
1238
Also note that we are currently unable to use queries defined in files other than the file where the <StaticQuery> is defined. If you're attempting to import the query, please move it into \\"query-imported.js\\". If being able to import queries from another file is an important capability for you, we invite your help fixing it.
1239
+
",
1240
+
],
1241
+
Array [
1242
+
"
1243
+
We were unable to find the declaration of variable \\"strangeQueryName\\", which you passed as the \\"query\\" prop into the useStaticQuery declaration in \\"static-query-hooks-not-defined.js\\".
1244
+
1245
+
Perhaps the variable name has a typo?
1246
+
1247
+
Also note that we are currently unable to use queries defined in files other than the file where the useStaticQuery is defined. If you're attempting to import the query, please move it into \\"static-query-hooks-not-defined.js\\". If being able to import queries from another file is an important capability for you, we invite your help fixing it.
1248
+
",
1249
+
],
1250
+
Array [
1251
+
"
1252
+
We were unable to find the declaration of variable \\"strangeQueryName\\", which you passed as the \\"query\\" prop into the useStaticQuery declaration in \\"static-query-hooks-imported.js\\".
1253
+
1254
+
Perhaps the variable name has a typo?
1255
+
1256
+
Also note that we are currently unable to use queries defined in files other than the file where the useStaticQuery is defined. If you're attempting to import the query, please move it into \\"static-query-hooks-imported.js\\". If being able to import queries from another file is an important capability for you, we invite your help fixing it.
997
1257
",
998
1258
],
999
1259
],
@@ -1006,6 +1266,14 @@ Also note that we are currently unable to use queries defined in files other tha
0 commit comments