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
Copy file name to clipboardExpand all lines: docs/docs/reference/release-notes/migrating-from-v3-to-v4.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,6 +258,53 @@ You can also learn more about this in the [migration guide for source plugins](/
258
258
259
259
The built-in type `SitePage` now returns the `pageContext` key as `JSON` and won't infer any other information anymore. The `SitePlugin` type now has two new keys: `pluginOptions: JSON` and `packageJson: JSON`.
260
260
261
+
#### Field `SitePage.context` is no longer available in GraphQL queries
262
+
263
+
Before v4 you could query specific fields of the page context object:
264
+
265
+
```graphql
266
+
{
267
+
allSitePage {
268
+
nodes {
269
+
context {
270
+
foo
271
+
}
272
+
}
273
+
}
274
+
}
275
+
```
276
+
277
+
Starting with v4, `context` field is replaced with `pageContext` of type `JSON`.
278
+
It means you can't query individual fields of the context. The new query would look like this:
279
+
280
+
```graphql
281
+
{
282
+
allSitePage {
283
+
nodes {
284
+
pageContext # returns full JS object passed to `page.context` in `createPages`
285
+
}
286
+
}
287
+
}
288
+
```
289
+
290
+
If you still need to query individual `context` fields - you can workaround it by providing
You can no longer use `gatsby-admin` (activated with environment variable `GATSBY_EXPERIMENTAL_ENABLE_ADMIN`) as we removed this functionality from `gatsby` itself. We didn't see any major usage and don't plan on developing this further in the foreseeable future.
0 commit comments