apollographql / apollographql/fullstack-tutorial

Login __generated__ file with mutation defined in lowercase is causing errors

Open
#179 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
808
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.