apollographql / apollographql/fullstack-tutorial
Login __generated__ file with mutation defined in lowercase is causing errors
- Langage dominant
- TypeScript
- Étoiles
- 1.2k
- Forks
- 808
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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)
}
`;
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Examinez la section sur la mutation liée dans l’issue, le fichier généré pages/__generated__/login.ts et server/src/__tests__/integration.js. Vérifiez que le nom de la mutation et les références aux types générés utilisent partout la même casse ; le code du tutoriel et le test d’intégration doivent être cohérents et ne plus produire les erreurs signalées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- graphql, javascript, typescript
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100