Skip to content

Guide: Create a new content type

Mario Vercellotti edited this page May 2, 2024 · 4 revisions

Drupal setup needed

  1. Create a new content type, add the fields. In this case we have called the content type "Test content" and we will have the body field, and a textfield called Testfield: image
  2. In order to use the preview functionality, you have to add it to the next-drupal setup:

image 3. configure the graphql_compose schema for the new content type, configure as follows: (note that we are enabling all checkboxes) image

  1. Create a node of your new content type:

image

We cannot commit the configuration changes here, but I have included the database used in my tests: db_with_content_type.gz

Frontend setup needed

  1. run lando npm run grapqhl-codegen to update the type definitions, now that we have a new content type.

  2. apply the code changes in this PR, I will add comments on the code.

Clone this wiki locally