apollographql / apollographql/fullstack-tutorial

Login __generated__ file with mutation defined in lowercase is causing errors

未关闭
#179 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1.2k
派生
808
PR 合并指标
30 天内没有已合并 PR

描述

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)
}
`;
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

检查 issue 中链接的 mutation 部分、生成的 pages/__generated__/login.ts 文件以及 server/src/__tests__/integration.js。确认 mutation 命名和生成类型引用始终使用相同的大小写;教程代码和集成测试应保持一致,并且不再产生报告中的错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
graphql, javascript, typescript
领域
documentation
Issue 类型
文档
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。