Skip to content

Commit

Permalink
chore(docs): Add note about query name to MDX
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Aug 19, 2022
1 parent dc283d7 commit 7b3286c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/how-to/routing/mdx.md
Expand Up @@ -319,7 +319,7 @@ For further reading, check out the [createPages](/docs/reference/config-files/ga

### Make a layout template for your posts

You can create a file called `posts.jsx` in `src/templates` - this component will be rendered as the template for all posts. Now, create a component that accepts your compiled MDX content via `children` and uses GraphQL `data` to show the title:
You can create a file called `posts.jsx` in `src/templates` - this component will be rendered as the template for all posts. Now, create a component that accepts your compiled MDX content via `children` and uses GraphQL `data` to show the title. **Please note:** The query must **not** have a name. This way Gatsby can create a unique one internally and the `__contentFilePath` in the next step will work correctly.

```jsx:title=src/templates/posts.jsx
import React from "react"
Expand Down

0 comments on commit 7b3286c

Please sign in to comment.