This message was deleted.
# 질문
s
This message was deleted.
h
list and count라는게 pagination을 의미하시는거라면 공식문서에 권장되는 패턴이 있습니다. https://graphql.org/learn/pagination/
t
1. 저는 필요하다면, connection field랑 count 프로퍼티를 따로 둬요
Copy code
type User {
  articlesConnection(...): ArticlesConnection!
  articlesCount: Int!
}
2. Relay Server Spec 참고하시면 컨벤션 정하는데 도움되실꺼같아요 ㅎㅎ
args 같은경우에는 where + data로 inputObjectType 묶어서 주로 써요.
Copy code
type Query {
  user(where: UserWhereInput!): User
  users(where: UsersWhereInput): [User!]!
  usersConnection(where: UsersWhereInput, first: Int, last: Int, after: String, before: String): UsersConnection!
}

type Mutation {
  createUser(data: CreateUserDataInput!): User!
  updateUser(where: UpdateUserWhereInput!, data: UpdateUserDataInput!): User
}
inputObjectType 이름을 필드명이랑 맞추면 편하더라구요 ㅋㅋ
👍 1
s
답변 감사합니다. 답변들 참고해서 더 공부해봐야겠습니다!
j
@Tony Won prisma를 쓰면 생성해주는 쿼리네임이랑 같군요 이게 GraphQL이 권장하는 컨벤션인가요???
t
엇 맞아요 ㅋㅋㅋ 근데 약간 다릅니다 ㅋㅋ 그냥 제가 쓰고있는 컨벤션이에요