# Variable "$uid" of required type "String!" was not provided

**URL:** <https://community.prismic.io/t/variable-uid-of-required-type-string-was-not-provided/952>\
**Category:** Developing with Prismic\
**Tags:** gatsby\
**Created:** [June 23, 2020, 12:57pm UTC](https://community.prismic.io/t/variable-uid-of-required-type-string-was-not-provided/952 "2020-06-23T12:57:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [June 24, 2020, 2:51pm UTC](https://community.prismic.io/t/variable-uid-of-required-type-string-was-not-provided/952/7 "2020-06-24T14:51:49Z")

</div>

Hello @christian!

There are a few things to note here:

1. When creating dynamic pages with [the Prismic Gatsby source plugin](https://prismic.io/docs/gatsby/getting-started/prismic-gatsby-source-plugin) you should use the plugin config rather than the config in gatsby-node. Check out this other thread where i answered a related question:

> [@Difference between using gatsby-node.js & plugins options for building pages dynamically](https://community.prismic.io/t/difference-between-using-gatsby-node-js-plugins-options-for-building-pages-dynamically/98/2):
>
> Hello Lance and welcome to the Prismic community forum! The differences are: With the gatsby-source-prismic-graphql plugin pages are dynamically generated inside the src/templates folder, and the necessary data for the queries is provided by the plugin as well as the URL slugs. And the gatsby-node.js file is the traditional Gatsby way of programmatically create pages from data. It requires a little bit more configuration like using [the onCreateNode method for the URL slugs, and createPages fo…](https://www.gatsbyjs.org/tutorial/part-seven/)

1. In the config for the pages, dynamic pages need to be created under the templates folder. Try and changing your "page component' to that folder, change the route in the plugin config and try again.

2. Since the plugin passes dynamic data to the queries, the lang parameter should be a variable instead of a literal value. Read [**How to dynamically query documents by language**](https://prismic.io/docs/gatsby/arguments-and-filtering/query-by-language#4_0-how-to-dynamically-query-documents-by-language)

3. This is an extra validation that is not related but important. When retrieving the data in your templates you must [Adding a validation check](https://prismic.io/docs/gatsby/rendering/retrieve-the-document-object#21_0-adding-a-validation-check).

---

_[View the full topic](https://community.prismic.io/t/variable-uid-of-required-type-string-was-not-provided/952)._
