velog.io/@ckstn0777/GraphQL-%EC%86%8C%EA%B0%9C
- GraphQL 소개
- GraphQL Query 기초
- GraphQL Query 심화
- GraphQL 스키마 설계
- [실습] GraphQL API 만들기 - 초기세팅
- [실습] GraphQL API 만들기 - 타입간 연결
쿼리
{
person(personID: 1) {
id
name
eyeColor
gender
edited
created
birthYear
homeworld{
name
orbitalPeriod
}
}
}
응답
{
"data": {
"person": {
"id": "cGVvcGxlOjE=",
"name": "Luke Skywalker",
"eyeColor": "blue",
"gender": "male",
"edited": "2014-12-20T21:17:56.891000Z",
"created": "2014-12-09T13:50:51.644000Z",
"birthYear": "19BBY",
"homeworld": {
"name": "Tatooine",
"orbitalPeriod": 304
}
}
}
}
스키마
"""An individual person or character within the Star Wars universe."""
type Person implements Node {
"""The name of this person."""
name: String
"""
The birth year of the person, using the in-universe standard of BBY or ABY -
Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is
a battle that occurs at the end of Star Wars episode IV: A New Hope.
"""
birthYear: String
"""
The eye color of this person. Will be "unknown" if not known or "n/a" if the
person does not have an eye.
"""
eyeColor: String
"""
The gender of this person. Either "Male", "Female" or "unknown",
"n/a" if the person does not have a gender.
"""
gender: String
"""
The hair color of this person. Will be "unknown" if not known or "n/a" if the
person does not have hair.
"""
hairColor: String
"""The height of the person in centimeters."""
height: Int
"""The mass of the person in kilograms."""
mass: Float
"""The skin color of this person."""
skinColor: String
"""A planet that this person was born on or inhabits."""
homeworld: Planet
filmConnection(after: String, first: Int, before: String, last: Int): PersonFilmsConnection
"""The species that this person belongs to, or null if unknown."""
species: Species
starshipConnection(after: String, first: Int, before: String, last: Int): PersonStarshipsConnection
vehicleConnection(after: String, first: Int, before: String, last: Int): PersonVehiclesConnection
"""The ISO 8601 date format of the time that this resource was created."""
created: String
"""The ISO 8601 date format of the time that this resource was edited."""
edited: String
"""The ID of an object"""
id: ID!
}
"""A connection to a list of items."""
type PersonFilmsConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [PersonFilmsEdge]
"""
A count of the total number of objects in this connection, ignoring pagination.
This allows a client to fetch the first five objects by passing "5" as the
argument to "first", then fetch the total count so it could display "5 of 83",
for example.
"""
totalCount: Int
"""
A list of all of the objects returned in the connection. This is a convenience
field provided for quickly exploring the API; rather than querying for
"{ edges { node } }" when no edge data is needed, this field can be be used
instead. Note that when clients like Relay need to fetch the "cursor" field on
the edge to enable efficient pagination, this shortcut cannot be used, and the
full "{ edges { node } }" version should be used instead.
"""
films: [Film]
}
graphql-kr.github.io/learn/schema/
'[WEB]' 카테고리의 다른 글
API 개념 (0) | 2021.04.06 |
---|---|
효과적인 프로그래밍 공부법 (0) | 2020.10.21 |
하위 .git 폴더 모두 제거 (0) | 2020.10.14 |
깃허브 터미널 사용법 (0) | 2020.10.14 |
WAS/Web Server/Web.xml (0) | 2020.07.15 |