RE: Validation Error on CreateDatabase query (Nodejs)

The Create query creates a document just fine in the specified collection;
however in the exact same step the CreateDatabase query yields a Validation Error.

If the database has been sufficiently authenticated for the Create query, why wouldn’t
it also hold sufficient for the CreateDatabase query running in the exact same step?

Which query/steps are you referring to?

Note that you cannot call CreateDatabase and also create documents within that database in a single transaction.

Hi Ewan…Noted.

I included the CreateDatabase query in a step that successfully executed;
then I commented out the working query (Create), leaving only the CreateDatabase query to run on its own.

I’ve attached a screenshot; Please let me know your thoughts.

Hi Ewan,

Were you able to take a look at the code in my last reply, and offer suggestions
as to why CreateDatabase query is generating a Validation Error?

Was there some extra parameter (beside {Data: name} ) that’s needed in the query?

Also, just FYI, the workflow is running in PipeDream (not Zapier).

Please advise.

Hi Ewan,

Never mind this one. This was definitely “User Error” on my part.

I’m having to learn Pipedream, Nodejs, & FQL on the fly, so I was making some faulty assumptions with this query.

Why I was insisting on using the “data” parm, and not the “name” parm
and why I didn’t see and catch this until just now will remain a mystery.

It did work when I made this very simple substitution…EUREKA!

My apologies, but I’ve been so intensely preoccupied in building up this API to work,
when I just needed to lighten up and take a step back, and just look with simplicity.

Been working and staring at my screen for way too long, under way too much pressure,
but I think I’ve finally touched back down to earth now. :slight_smile:

Thanks Much!

1 Like

Fauna, by itself, is challenging to learn. Trying to learn three technologies at once is… ambitious!

I’m glad you got your query sorted out. Let us know if you run into any other problems.

Yes Ewan. You are absolutely correct… Whew!

But amazingly, my Back-End-Stack is starting to gel!

When I commented out the “Create” query, I also copied and pasted
a portion of it to preserve some formatting for the “CreateDatabase” query
and in doing so, the “data” parm was left intact, and didn’t appear out of place
as many Nodejs objects readily use this parm so very often.

So my faulty assumption was that the “data” parm was also included
in the “CreateDatabase” query. So then I was just disregarding it.

And because the error that was thrown was a "Validation Error,"
I immediately thought "authentication."

I think had I seen an “Invalid Query” type message, it would have drawn
my attention to the query , and not authentication, as the error focus.

But… Lesson learned moving forward…

… And thanks for extending your support.

1 Like