Skip to content

getStaticPaths() suggested usage #515

Answered by zackolsonHS
zackolsonHS asked this question in Q&A
Discussion options

You must be logged in to vote

For those that may come to this and are wondering what resolved this issue, here was my solution.

When issuing GQTY queries from within getStaticPaths(), both client.client.resolved() and client.client.inlineResolved() were returning with a proxy yielding undefined data. Just returning the query we wanted (ie. client.client.query.generalSettings) was not sufficient to then access such values outside of the inlineResolved() callback. To get non-undefined data, you need to specify what fields you want to pull in within the inlineResolved() callback using one of GQTY's core helper functions. We used getArrayFields() as that was more appropriate for the use case within getStaticPaths().

Examp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zackolsonHS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant