DEV Community

Dmitry Vdovichenko πŸ’»πŸ€˜
Dmitry Vdovichenko πŸ’»πŸ€˜

Posted on

2 1

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

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 :)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay