Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hosting GraphQL server #76

Merged
merged 16 commits into from
May 27, 2024
Merged

feat: hosting GraphQL server #76

merged 16 commits into from
May 27, 2024

Conversation

boscohyun
Copy link
Contributor

@boscohyun boscohyun commented May 23, 2024

  • Introduce Lib9c.GraphQL project with some types: PlanetNameType, SheetNameType, SheetType for SheetObject.
  • Configure GraphQL service to Mimir project with some queries: sheetNames, sheet
  • Run project and connect to {host:port}/graphql.
# schema definition
"""
The name of the planet.
See https://planets.nine-chronicles.com/planets/ or https://planets-internal.nine-chronicles.com/planets/ for more information.
"""
enum PlanetName {
  """
  The name of the planet odin.
  """
  ODIN

  """
  The name of the planet heimdall.
  """
  HEIMDALL
}

scalar SheetNameType

type SheetObject {
  """
  The name of the sheet.
  """
  name: SheetNameType!

  """
  The CSV content of the sheet.
  """
  csv: String

  """
  The JSON content of the sheet.
  """
  json: String
}

type Query {
  sheetNames(planetName: PlanetName!): [String!]!
  sheet(planetName: PlanetName!, sheetName: SheetNameType!): SheetObject!
}

@boscohyun boscohyun requested review from moreal, Atralupus and a team May 23, 2024 14:02
@boscohyun boscohyun self-assigned this May 23, 2024
@@ -0,0 +1,8 @@
namespace Lib9c.GraphQL.Objects;

public class SheetObject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a reason you created a separate class to implement it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Mimir's existing API, users could get a sheet in either CSV or JSON when they requested it. To adapt this to GraphQL, I defined a separate object.
Later on, I also expected this SheetObject to have a sheet address of type Address added to it.

미미르에서 기존에 제공하던 API에서는 사용자가 시트를 조회할 때, CSV나 JSON 중 원하는 형태로 받을 수 있었습니다. 이를 GraphQL에 적용하기 위해서 별도의 오브젝트를 정의했습니다.
이후에는 이 SheetObjectAddress 타입의 시트 주소가 추가되는 걸 기대하기도 했습니다.

@boscohyun boscohyun requested review from ipdae and Atralupus May 24, 2024 06:47
@boscohyun boscohyun merged commit 78ed65c into main May 27, 2024
3 checks passed
@boscohyun boscohyun deleted the feat/hosting-graphql-server branch May 27, 2024 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants