Closed vSterlin closed 4 years ago
Hello!
This will be easy enough to do, as it looks like product
is expandable on the Price object. I won't be able to get to this until later in the week, but if you want to follow the pattern found in stripeObjects.json
for expand
ing fields for other objects, feel free to add for Price
and make a PR!
Thanks!
It looks like the Price object has now been added to the stripeObjects.json is there a way to query for that now? The only example is see is still the allStripeSku, which does not work with newer accounts.
@brittneypostma Hello! Having more examples of querying for other types of Stripe objects would be great - happy to accept any PRs updating the README with more examples.
As far as querying for Prices, have you tried adding it to your plugin config like so:
{
resolve: `gatsby-source-stripe`,
options: {
objects: ['Price'],
secretKey: 'stripe_secret_key_here',
}
}
If the above works, you should be able to open Graphiql and see allStripePrice
. If you don't, happy to help you debug further!
@vSterlin also thanks for the PR, will get that merged this weekend!
I have added it to the objects as shown above, but allStripe does not show up in Graphiql.
Edit: I realized I was using an older account with the sku api. After updating my keys to the correct account it is querying. I will try and add a pr for the readme if I get something working. Thanks!
Oh great! Glad to hear that querying is working! Looking forward to that PR and don't hesitate to reach out if you run into additional issues / have additional questions.
This is now merged! Feel free to create a new issue if you run into an issue :)
It looks like SKUs are not used with Stripe Checkout anymore, they use Price object instead (there is no way to add SKU in Stripe dashboard). When I query allStripePrice with the plugin, I can retrieve the product's id but not its name, so I need a separate query for Stripe products to retrieve the product's name which is inconvenient. If it would be possible to retrieve product's name from price query it would be a great addition to plugin.