DEV Community

Cover image for How to create a job board with Fauna and Redwood.js

How to create a job board with Fauna and Redwood.js

Amolo on December 03, 2020

INTRODUCTION Redwood.js & Full Stack Redwood is an opinionated, full-stack, serverless web application framework that ena...
Collapse
 
jiftuq profile image
chris

Great explanation

Collapse
 
amolo profile image
Amolo

Thanks. Much appreciated.

Collapse
 
jiftuq profile image
chris

I get this error when I localdeploy
Failed to compile.

./src/pages/HomePage/HomePage.js
Module not found: Error: Can't resolve '../../components/ListingsCell' in

Can you help me?

Thread Thread
 
amolo profile image
Amolo

Could you paste the whole error message.
I also hope you are running using

yarn rw dev
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
amolo profile image
Amolo

Alternatively you can follow the tutorial using this repo
github.com/brianraila/rw-fauna

Thread Thread
 
jiftuq profile image
chris

In rw-fauna/api/src/lib/db.js
you changed 'Bearer ' to Bearer ${process.env.FAUNA_KEY}

Thread Thread
 
amolo profile image
Amolo

Oh yes sorry about that.
You should set the env variable FAUNA_KEY to your Fauna database key. But that is specified in the tutorial.
However, the code sample works seamlessly. You can use it as a reference.

Thread Thread
 
jiftuq profile image
chris

Now i get this error

POST /graphql 400 4.578 ms - 1572
api |
api | GraphQLError: Cannot query field "listings" on type "Query".
api |
api |
api | 1 Object.Field
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\graphql\validation\rules\FieldsOnCorrectTypeRule.js:46
api |
api | 2 Object.enter
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\graphql\language\visitor.js:323
api |
api | 3 Object.enter
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\graphql\utilities\TypeInfo.js:370
api |
api | 4 visit
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\graphql\language\visitor.js:243
api |
api | 5 Object.validate
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\graphql\validation\validate.js:69
api |
api | 6 validate
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\apollo-server-core\src\requestPipeline.ts:510
api |
api | 7 anonymous
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\apollo-server-core\src\requestPipeline.ts:296
api |
api | 8 fulfilled
api | C:\Users\christophe\Desktop\Nouveau dossier - Copy\job-board\node_modules\apollo-server-core\dist\requestPipeline.js:5
api |

Thread Thread
 
jiftuq profile image
chris

Did you add the rw-fauna/api/src/graphql/listings.sdl.js file?

Thread Thread
 
jiftuq profile image
Info Comment hidden by post author - thread only accessible via permalink
chris

And you missed a } on the second mutation

 
amolo profile image
Amolo

Thanks for the heads up. I will take a look at that. But all the Github code is up to date on that.
Also kindly confirm that you imported the schema to your Fauna database.

Thread Thread
 
jiftuq profile image
chris

I imported the schema and the github code works.
Its just that i can't run it locally.

Thread Thread
 
amolo profile image
Amolo

What exactly is the issue now?

Collapse
 
jiftuq profile image
chris

Can you show how to create a page to input the data(jobs) with the graphql?

Collapse
 
amolo profile image
Amolo

Great, I will make some time to do that.

Some comments have been hidden by the post's author - find out more