Could you take a screenshot of your REST API configuration in Composer Data Configurator? The correct place to configure the payload is under POST request body on the Schema tab.
However, considering that the query object seems to be highly dynamic, you might want to consider using just the HTTP request flow function, copypasting your query as a formula in the Request body field
and then if needed, wrapping the whole thing with a custom flow function so you can define the proper schema for the response. Would that approach make more sense?
Not yet. I get it to work on some instances, but not in others. The request schema seems to change depending on the query, which is highly inconvenient. I’m trying to find out what are the rules for a working schema, because up to now it’s trial and error. One thing is for sure, the GET schema is not accepted on the other http calls, as the GET schema includes information that Firestore sets by itself and can not be passed on the request.
I get a query by record (document) id without problem, as stated on the tutorial post. Once I figure out the rules for a query by field I will edit the post to include this kind of call, because it is much more useful.
All right! Note that if there are fields that are dynamic, you can edit the schema manually to make it e.g. just an “object” instead of object with specific properties. This will mean the user must know the structure and use formula functions “blindly” to access it, but this is one (hacky) way to support dynamic schemas in REST APIs.
and the response schema from it.
However, I have been unable to use the response data because I can not find where is it available.
I feel I am almost there getting Firestore Cloud to work (got every thing else: GET, GETALL, DELETE, POST) and would really appreciate your help with this.
That’s a mismatched type, so changing the schema of the .stringValue field to match the target binding schema should work. If you know internally that the data will match, you can also always use formulas for the binding – it will complain about mismatched schema but execute the binding regardless.
Thanks Harry, I used a formula to assign the response values to a variable and it worked. Now is clear how to query Firestore by fields. I have the full tutorial ready now.
Eduardo, maybe slightly off topic, but can you explain to a new user why they’d want/need to use Firestore above and beyond the data store provided with AppGyver?
Like clearly keeping your data outside of a single solution is a big one, so if AG ever disappeared then you’d at least still have your data.
Are there also technical reasons, like projects that can’t be built with the internal data store?
Firestore is a non relational (NoSQL) database. As such, it is ideal for data that in someway, or for some reason, needs redundancy or the redundancy is inherent to it, be it structured or not (ie. documents).
“Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform. It keeps your data in sync across client apps through realtime listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity. Cloud Firestore also offers seamless integration with other Firebase and Google Cloud Platform products, including Cloud Functions”
What I find special, besides the aforementioned and it being easy to setup, is that it has a free usage policy for low traffic use (as of july 1, 2020, it’s free up to 50.000 reads/day, 20.000 writes/day and 20.000 deletes/day) that allows its free use for many applications and, if needed, growth is not a problem.
UPDATE:
Hello everyone, my issue is solved and I can now populate the runQuery data into the page variable. Want to share my learning with the community.
Hi, trying to do the same thing but unfortunately not successful at the API Explorer stage itself. Any help would be highly appreciated. I know you guys are busy like crazy but tagging the ever helpful @Harri_Sarsa, @Mari and @Mevi Here is my curl and the response error: