Closed spikyjt closed 3 years ago
Additionally, I've tried this in a static query as well as a page query and neither work.
@spikyjt I noticed that you mentioned that you're able to run the query successfully in the GraphiQL explorer. Is that the case? If so, that makes me think that Gatsby is getting the data just fine from the Stripe API, and there's an issue with how you're querying it in your code. Can you share a screenshot of the results you get when you do the query in the explorer as well as can you share the full query you're using in code?
Thanks!
@njosefbeck I'm an idiot! The problem was actually in another query on an individual product page, that hadn't been updated to use the stripe objects yet, but queried a resource called product. I got confused because I wasn't viewing that page, but of course it get's rendered at build time, so the query was still being run.
Sorry to waste your time.
No worries! Glad you figured it out!
Prerequisites
[X] Put an X between the brackets on this line if you have done all of the following:
Describe the bug GrapghQL query for the product field as a property of a price object (
allStripePrice
) errors with:This includes a suggestion that the field cannot be queried if it is optional, as Gatsby can't infer the type in the schema.
To Reproduce Steps to reproduce the behavior:
gatsby-source-stripe
to useobjects: ['Product', 'Price']
Expected behavior product field can be queried on price objects as it always present on responses from the Stripe API (expandable).
Screenshots If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
os: macOS 10.15.7 node: 14.15.5 npm: 6.14.11 gatsby: 2.32.3 gatsby-source-stripe: 3.2.1
Gatsby config:
Copy the portion of your Gatsby config for this plugin here. Do not include your
secretKey
.Additional context If I run this query in the GraphiQL explorer, it works fine!