Apollo `useMutation()` stuck loading inside Next.js component

The following form component in Next.js submits without errors but never completes the mutation. Instead it get's stuck in the loading state.

import React, { useState } from "react";
import { gql, useMutation } from "@apollo/client";
import { ApolloClient, InMemoryCache } from "@apollo/client";

const client = new ApolloClient({
  ssrMode: true,
  uri: process.env.API_URL,
  cache: new InMemoryCache(),
});

const CREATE_COMMENT = gql`
  mutation CreateComment(
    $username: String!
    $comment: String!
  ) {
    createComment(
      data: { username: $username, comment: $comment }
    ) {
      id
      username
      comment
    }
  }
`;

export default function SocialForm() {
  const [commentName, updateCommentName] = useState("");
  const [commentDescription, updateCommentDescription] = useState("");
  const [createComment, { data, error, loading }] = useMutation(
    CREATE_COMMENT,
    { client }
  );

  const handleFormSubmit = async () => {
    await createComment({
      variables: {
        name: commentName,
        comment: commentDescription
      },
    });
  };

  if (loading) return "loading...";
  if (error) return <p>error text :(</p>;
  return (
    <>
      <form
        onSubmit={async (e) => {
          e.preventDefault();
          await handleFormSubmit();
        }}
        className="social-form"
      >
        <input
          required
          onChange={(e) => updateCommentName(e.target.value)}
          type="text"
          placeholder="Full Name"
          className=""
        />
        <textarea
          required
          maxLength="280"
          onChange={(e) => updateCommentDescription(e.target.value)}
          className="w-full"
          name="comment"
          rows="5"
          placeholder="Leave your thoughts and images at the moment"
        />
      </form>
    </>
  );
}


Also the server side mutation with this exact same schema runs correctly inside Apollo playground and I'm using Keystone.js to auto generate the schema.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum