Game of Thrones Quiz Game with React and GraphQL: Handling Mutations with 8base

Publikováno: 17.6.2019

To begin creating questions, we’ll have to run mutations on the Questions table; a quick trick is to look at the 8base API explorer to see how the mutation script should look like. Go the to 8base ...

Celý článek

To begin creating questions, we’ll have to run mutations on the Questions table; a quick trick is to look at the 8base API explorer to see how the mutation script should look like. Go the to 8base dashboard and click on the API explorer on the sidebar.

On the API explorer, click on the mutation link as seen above. This will present all the mutations for all available tables on your 8base dashboard. Look for that of the questions table.

From the screenshot above, we can see that the name of the mutation is questionCreate and it takes a single argument data of type QuestionCreateInput. The QuestionCreateInput consists of the fields required to create a question. If you have already forgotten the fields required to create a question, you can click on the QuestionCreateInput link to view the fields.

Before we get to writing mutations to create questions, we need to update the guest permissions on the application. We need to enable file create access for guest users. Navigate to Settings > Roles > Guest and check the create box under File.

Now that we know how the data required for creating questions can move back to our application make the changes required for creating questions.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace