Working with Relations and GraphQL Union Types

Jamie Barton
Jamie Barton

January 17, 2021

Connecting a relation

  1. Open a content entry you'd like to connect a relation to.
  2. Locate the relation field.
  3. Choose between "add an existing..." or "create and add a new..." of whatever model you are wanting to connect.

When pressing on:

Add an existing

  • A popup listing all the possible entries of that model will appear.
  • Press the link icon at the far left of the content entry.

Create and add new

  • An in-line content editor window for the selected type will appear.
  • Fill out for the form's fields.
  • Choose to "save" or "save and publish" to create a DRAFT or DRAFT and PUBLISHED entry in the related model. Connecting will happen automatically.

Connecting multiple types to a relation

Follow the steps from "Connecting a Relation", when you press on either of the buttons, an intermediate select box will have you first decide with model you want to choose from or create a new entry in.

Disconnecting a relation

  1. Open a content entry you'd like to disconnect a relation to.
  2. Find the relation field you'd like to remove a conenction from.
  3. Click on the broken link icon at the far right of the content entry.

Sorting a relation

  1. Open a content entry you'd like to sort relations on.
  2. Find the relation field you'd like to sort.
  3. Grab the four dot handle at the left edge of the content entry and drag up and down in the list.

It's Easy To Get Started

GraphCMS plans are flexibly suited to accommodate your growth. Get started for free, or reach out to our sales team to discuss larger projects with more complex needs

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy