Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 19, 2021 10:45 am GMT

GraphQL Schema - The Beginner's Guide to GraphQL Editor p.1

GraphQL Editor is a tool for both advanced users and those only starting to work on GraphQL APIs.

On the off chance you don't know anything about GraphQL Editor it's a web tool that lets you see and better understand how the schema and various elements within it work, even if youre not a programmer.

You can even build a schema by joining the visualized blocks and having GraphQL Editor generate the code for them. Thats just the basics and tool has lots of other useful features a bunch of them added in the recent GraphQL Editor v. 4.5 update.

Schema

So lets try it out and set up a very basic schema that should be easy to grasp even for someone completely new to GraphQL. Lets start by setting up the contact form input:

  • Let's add strings (email and message),
  • we want make them required.

Schema

Creating Mutations

Now it's time for the types. First let's add a mutation, for this sample mutation we will:

  • add a type & set it as a mutation,
  • make it required,
  • add boolean.

Mutations

Query

All we need now is a query to fetch the data, for that first lets:

  • make a form type with strings for email and message,Form
  • For the query we do the same thing we did before: add type, select query and once again make it required.
  • Now let's make it fetch from the form we made above so remember to check required and also check array and array required here as well.Query

And it's done

As you can see as we finished this last step it automatically rounds it out as a schema and we can even find out how it looks in the visualization:

Visualization

And thats it, you just created a simple GraphQL schema that can fetch two basic values like emails and messages from a database. Obviously, we haven't even scratched the surface of what GraphQL Editor can do so hopefully youll stick around to see what we do next time.

A guest blog post for GraphQL Editor blog by Micha Tyszkiewicz

Speed up your GraphQL API development

GraphQL Editor is a supportive tool for both advanced GraphQL users as well as those taking their first steps with GraphQL APIs. Our all-in-one development environment for GraphQL will help you build, manage & deploy your GraphQL API much faster. Try GraphQL Editor for free!

New features of GraphQL Editor gif


Original Link: https://dev.to/graphqleditor/graphql-schema-the-beginner-s-guide-to-graphql-editor-p-1-3c3

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To