Skip to content

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

@celiagomezdev

Description

@celiagomezdev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions