Relay mutation is not resolving synchronously in test

I have the following code essentially.

// MyComponent.js
const myMutation = graphql`
  mutation myMutation($input: MyInput!) {
    doMyMutation(input: $input) {

const MyComponent = () => {
  const [mutate] = useMutation(myMutation)
  const handleClick = async () => {
    const variables = {
      input: {
        stuff: true
    await mutate({ variables })
    myfunction('Hello World')

  return <button onClick={handleClick}>Click Me</button>

export default MyComponent

// test.js
import myfunction from './myfunction'

it('should finish mutation', async () => {
  environment.mock.queueOperationResolver(operation =>

  const { getByText } = render(<MyComponent />)'Click Me'))

  expect(myfunction).toHaveBeenCalledWith('Hello World')
  // expect(AsyncRequestStore.clickToCall).toHaveBeenCalledTimes(2)

// myfunction.js
const myfunction = (message) => {

export default myfunction

However, when I run the test, the mutation finishes after the test runs, saying there is something async going on. There are non timers I can see directly in my code. What could be causing this to not resolve the mutation until several frames/milliseconds later?

I would expect myfunction (which is mocked with jest.mock('./myfunction') to be called with Hello World, but it is not being called by the time at this point in the test, it only gets called after the test is done.