apollographql / apollographql/fullstack-tutorial
Login __generated__ file with mutation defined in lowercase is causing errors
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 808
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Following the official documentation and the rest of the tutorial, queries and mutations are defined with the first letter in uppercase (PascalCase). However, in this [part of the tutorial](https://www.apollographql.com/docs/tutorial/mutations/#define-the-mutation) the mutation `Login` is defined lowercase (I see that in the final version of the tutorial this is corrected):
```gql
export const LOGIN_USER = gql`
mutation login($email: String!) {
login(email: $email)
}
`;
```
The corresponding generated file (`pages/__generated__/login.ts`), `Login` type appears as well in lowercase but the related code is assuming they are in uppercase, throwing errors:
```gql
const [login, { loading, error }] = useMutation<
LoginTypes.Login,
LoginTypes.LoginVariables
>(LOGIN_USER);
```
The mutation `Login` in the integration tests (`server/src/__tests__/integration.js`) is also defined in lowercase:
```gql
const LOGIN = gql`
mutation login($email: String!) {
login(email: $email)
}
`;
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Xem lại phần mutation được liên kết trong issue, tệp được生成 pages/__generated__/login.ts và server/src/__tests__/integration.js. Kiểm tra rằng tên mutation và các tham chiếu đến kiểu được tạo sử dụng cùng một cách viết hoa và viết thường trong toàn bộ mã; mã tutorial và integration test phải nhất quán và không còn tạo ra các lỗi đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- graphql, javascript, typescript
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 55/100