GraphQL schema - starwars

How to make a diagram of your GraphQL schema

Several tools can be used to visualize existing GraphQL schemas. Some of them allow you to browse the structure in the form of a hierarchical tree. Moon Modeler, on the other hand, offers the ability to visually model new GraphQL schemas and also automatically create diagrams from existing sources.

GraphQL data modeling

Before we show how to make a diagram of your GraphQL schema, let’s take a look at how to easily create a brand new GraphQL schema diagram.… Read the rest

Import GraphQL from file

Importing a GraphQL schema from a file

Moon Modeler is a data modeling tool and one of its most used features is the modeling and visualization of existing GraphQL schemas. In this section we will look at the ability to import a GraphQL schema from a file.

In the demonstration we will use the StarWars schema. If you want to try the procedure, save the file from the page: https://github.com/graphql/swapi-graphql/blob/master/schema.graphqlRead the rest

Import GraphQL from URL

Importing a GraphQL schema from URL

In Moon Modeler you can

  • model new GraphQL schema diagrams,
  • import an existing schema defined in JSON format,
  • and also import GraphQL schema from online sources.

In this section, you will learn how to import a GraphQL schema from an online source and how to modify the visualization. The StarLink schema, available at https://api.spacex.land/graphql/Read the rest

Script generation for GraphQL

To generate scripts from your GraphQL project click the Script icon on the main toolbar. New modal opens. Click Save Script and select a location where the file should be stored. Option Overwrite existing files allows you to ignore existing scripts and overwrite them without getting a warning.

Generated script for GraphQL

#

Line modes in GraphQL schema diagram

Moon modeler offers two possibilities how to display lines between referenced objects. By default, the display mode where parent object is linked to a specific field in child object is active.

Default line mode:

detailed line mode

You can easily change that mode to Simple line mode. In this mode, lines are referenced from one object to another, in practice it means that can be anchored to bottom or to top of a graphical representative.… Read the rest

Quick links

Free Trial Buy Now!

Blog categories