Quick question: I am building a dynamic `CardStack...
# prisma-whats-new
d
Quick question: I am building a dynamic
CardStack
that takes in an
ImageURL
a
name
and a
price
from a price index API that I am using. How can I have my
CardStack
approve the addition of a new card based on my API and whether it has that price for that certain item? As well as decline the addition to the
CardStack
if the API doesn't have the price.
n
@domthegrom hey, that's a first question, and a great one indeed 😛 I was waiting for it haha
😀 1
From your description it sounds like you want to validate the input parameters for every
createCardStack
mutation based on an external API, is that correct?
👍 1
You can do so using a function across the request pipeline. Typically you would use
PRE_WRITE
for that: https://www.graph.cool/docs/reference/functions/request-pipeline/communicate-with-external-apis-phe1gei6io/#call-to-external-api
d
That's exactly what I want to do! Thanks for the info! Going to comb through it now and see how it works