DEV Community

Dmitry Vdovichenko 💻🤘
Dmitry Vdovichenko 💻🤘

Posted on

Understanding basic GraphQL Schema

It's my first post on DEV. Also, I'm not an expert in GraphQL, I'm just learning it, so...

Goal: understand how GraphQL Schema is working.

I've decided to rebuild my portfolio website with Gatsby. So I started to learn from Gatsby Tutorial how to work with Gatsby. In tutorial-part-four, reading about data in Gatsby, I move to [howtographql tutorial] cause I've had no experience with GraphQL before. If you check out basic core concept for GraphQL you can see an example of Schema Definition:

type Query {
  allPersons(last: Int): [Person!]!
}

type Mutation {
  createPerson(name: String!, age: Int!): Person!
}

type Subscription {
  newPerson: Person!
}

type Person {
  name: String!
  age: Int!
  posts: [Post!]!
}

type Post {
  title: String!
  author: Person!
}
Enter fullscreen mode Exit fullscreen mode

Trying to understand, how it works I write short syllabus about core concepts from full article for myself in Russian.

And also I've created picture for visual perception. Hope, it'll help somebody.

GraphQL Schema

Top comments (3)

Collapse
 
tomekponiat profile image
Tomek Poniatowicz

You should try visualize your GraphQL schema in graphql in app.graphqleditor.com
It's super easy!

Collapse
 
dmitryvdovichencko profile image
Dmitry Vdovichenko 💻🤘

Thanks for this awesome app! Already begin to read Docs. Once I've done with the Getting Started section, I've got that it's very simple & clear representation for a schema.

Collapse
 
tomekponiat profile image
Tomek Poniatowicz

You are welcome :)