Good chance I’m doing it wrong. So tell me if my approach is off.
I’m basically trying to merge the tutorial with the Weather API cookbook with multiple requests (just to build out the feature set for the tool I’m actually trying to build).
- Multiple form inputs
- That when submitted look in the DB for matching entries
- That if they’re not found, hit an API to create a DB entry
- Then show the either found or created entry
It’s going well so far. My cell runs a query, and if the query returns empty, i have the Create mutation running inside the Empty component. (This is the “maybe in doing this in the wrong place/way part).
If the entry exists the first time, it returns the success result like it should.
Only problem I have is that I don’t know how to make the component reload from the Empty state to the Success state, after it has created a DB entry.