Proposing a new category for RWJS Discourse

The name should be something like “high level problem solving” rather than debugging. In order to explain what I mean by that I will use a concrete example of my current problem:

I decided to carefully read and write the code for RWJS tutorial, paying attention to every detail, with the intent to provide the statement “tutorial is flawless” to the team. Just like the tutorial suggests, I was writing the code as suggested resulting with the repository at GitHub - adriatic/rw-blog.

This process was enjoyable - until I hit the section Saving Data. Providing the feedback that I had difficulties reconstructing this section does not imply how this section is not as well presented as the rest of the tutorial would not be a be a big story, so I am writing this to explain “my inspiration” triggered by my failure to find what did I miss.

More details: I reached up to (not including) the section Improving the Contact Form. Trying to run the app, I am getting:

{"error":"Function \"\" was not found.","availableFunctions":["graphql"]}

Note that all aspects of this app are working correctly - just the attempt to store the existing two blog posts to the database fails.

My question is: how to find out what is wrong here - where the most likely issue is in the file ContactPage.js invoking something in the back-end, a situation not easy (at least to me) to debug.

I am not trying to find a good soul that will pick in my version of the tutorial - but rather a suggestion to collect as many examples as as feasible of such situations and analyze them in a way to give hints for “high level debugging”. The characteristics of this back end is that in order to be able to step through instructions on the back end requires intimate knowledge of GraphQL and Prisma.

Anyone in favor of such effort (I may be close to volunteer, assuming sufficient number of likes)

1 Like

@adriatic do you mind updating the description it is not clear what this is supposed to be.

Sorry @KrisCoulson - I was interrupted while writing it and forgot to finish it. Coming momentarily

It’s difficult to debug given just a single line of output ({"error":"Function \"\" was not found.","availableFunctions":["graphql"]}). I usually take hints from the context when trying to figure out what’s wrong. Like, any more output on the server side (terminal output)? Any more output on the client side (browser console)? What did I change between now and when it was last working? Can I back-trace to a working state to pinpoint the breaking change?

Also, to try to isolate the error, I might try running just the graphql playground (http://localhost:8911/graphql and/or http://localhost:8910/.redwood/functions/graphql). If that’s not working the problem is most likely on the api side of things. If it is working I’d focus more on the web side of things.

I will do the needed research using your suggestion and will post the problem solution here. My hope is that I may get sufficient amount of likes to make this the the first entry in the proposed new category “high level problem solving”.

Not only that I did not get any interest for this “new category”, this specific case that I wanted to use as an introduction, turns out to be an instance of incorrectly defined RW project.

As the conclusion, allow me a couple of statements:

  • It would be nice to have a tool (say rw-doctor) which can verify the correctness of a project - by asserting that all the .files created by the create-redwood-app are present and correct.

  • Folks like me, that do not have established RW seniority, should not propose creation of new project. There are plenty of unresolved issues that already have management blessing, that need to be addressed in order to reach the version 1.0 :sweat_smile:

  • The side effect of my verification of the Tutorial completeness, is my conclusion that the Tutorial is really a very important component of RW and that is error free.

1 Like

Added later, to better explain the “rw-doctor” entity

It would be nice to have a tool (say rw-doctor) which can verify the correctness of a project - by asserting that all the .files created by the create-redwood-app are present and correct.

This task (verification the correctness of a project) in the RWJS context, is best implemented as an additional role of the CLI tool.

Note that the verification of the projects correctness / consistency means to offer that support at any initial and later stage of the project development. This implies that initially it acts as the reversal of the created-redwood-app. The further the project evolves (creating pages, cells services, mutations, etc) the usefulness such enhanced CLI tool will be more obvious.

This is just a hint, intended to measure the enthusiasm of the team for such functionality

Have you looked at the existing yarn rw check utility? Do you think your proposed features would be a good fit for adding to that tool?

Hello @Tobbe , yes I was warned about the existence of rw check (after I wrote the few entries in this thread) and yes, rw check implements parts of this idea. I am a bit more ambitious asking for uncreate rw application which would allow me to logically replace some of my choices I took in the process of building the app initially started with “create-application”.

As you may have noticed @cannikin explained the limits of the “create-application” tool. In addition, my idea to enrich the create-redwood-app is misplaced in the context named “Proposing a new category for RWJS Discourse” - where I planned the enumeration of various issues that are not easily debugged like

{"error":"Function \"\" was not found.","availableFunctions":["graphql"]}'

which was caused by missing one of many “dot-files”

Hi All! I’m a bit late to the party here. Based on some conversation with @adriatic we’re going to iterate on a new project category I’m currently naming “Debugging & Problem Solving”. We can update Title and description as we go.

I just wanted to help get things started. (And then get out of the way!)

1 Like