Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Login __generated__ file with mutation defined in lowercase is causing errors #179

Open
celiagomezdev opened this issue Nov 17, 2020 · 0 comments

Comments

@celiagomezdev
Copy link

celiagomezdev commented Nov 17, 2020

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 the mutation Login is defined lowercase (I see that in the final version of the tutorial this is corrected):

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:

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:

const LOGIN = gql`
  mutation login($email: String!) {
    login(email: $email)
  }
`;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant