Functions from a GatsbyJS Theme #32237
Answered
by
KyleAMathews
kalebheitzman
asked this question in
Help
-
Is there a plugin similar to gatsby-plugin-page-creator that will map functions defined in a theme to the host Gatsby site? When I test the function from the host site under Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
KyleAMathews
Jul 5, 2021
Replies: 1 comment 2 replies
-
You need to add the plugin to So odds are you're not putting your function in the right folder in your theme. See the PR adding this functionality #31466 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kalebheitzman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to add the plugin to
my-plugin/src/api/my-plugin/my-function.js
and then you can access the function at/api/my-plugin/my-function
So odds are you're not putting your function in the right folder in your theme. See the PR adding this functionality #31466